# code-snippets/3.9.1/js/utils/restAPI.ts

Code Snippets, version 3.9.1. 13 lines.

- Page: https://pluginprobe.com/plugins/code-snippets/3.9.1/code/js/utils/restAPI.ts
- Raw: https://pluginprobe.com/plugins/code-snippets/3.9.1/raw/js/utils/restAPI.ts
- Modified: 2025-08-29T08:54:36+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-snippets/3.9.1/code/js/utils/restAPI.ts#L10-L20`.

```typescript
import { trimTrailingChar } from './text'
import type { AxiosRequestConfig } from 'axios'

export const REST_BASE = trimTrailingChar(window.CODE_SNIPPETS?.restAPI.base ?? '', '/')
export const REST_SNIPPETS_BASE = trimTrailingChar(window.CODE_SNIPPETS?.restAPI.snippets ?? '', '/')

export const REST_API_AXIOS_CONFIG: AxiosRequestConfig = {
	headers: {
		'X-WP-Nonce': window.CODE_SNIPPETS?.restAPI.nonce,
		'Access-Control': window.CODE_SNIPPETS?.restAPI.localToken
	}
}

```
