# JsonPivotSourceOptions (@salmonui/data/json)

> The JsonPivotSourceOptions interface of @salmonui/data/json.

Canonical: https://salmonui.dev/docs/reference/data/json/JsonPivotSourceOptions

```ts
import type { JsonPivotSourceOptions } from '@salmonui/data/json';
```

Also exported from `@salmonui/data`.

Entry index: https://salmonui.dev/docs/reference/data/json (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data/json.md).

## Reference

Kind: interface

```ts
interface JsonPivotSourceOptions {
    readonly url?: string;
    readonly fetch?: FetchLike;
    readonly headers?: Readonly<Record<string, string>> | (() => Readonly<Record<string, string>>);
    readonly batch?: boolean;
    readonly transport?: PivotJsonTransport;
    readonly policy?: RequestPolicy;
    readonly scheduler?: Scheduler;
    readonly onRequest?: (event: PivotRequestEvent) => boolean | void;
    readonly onResponse?: (event: PivotResponseEvent) => WireAnyResponse | void;
    readonly onError?: (event: PivotRequestErrorEvent) => void;
}
```

Members (10):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `url` | `readonly url?: string;` | optional | Endpoint for the default fetch transport. Ignored when `transport` is set. |
| `fetch` | `readonly fetch?: FetchLike;` | optional |  |
| `headers` | `readonly headers?: Readonly<Record<string, string>> \| (() => Readonly<Record<string, string>>);` | optional | Request headers (auth), or a function read per request. |
| `batch` | `readonly batch?: boolean;` | optional | Multiplex same-tick requests into one `{ v: 1, batch }` POST. Default true. |
| `transport` | `readonly transport?: PivotJsonTransport;` | optional | Custom transport (auth refresh, signing, WebSocket, in-process handler). |
| `policy` | `readonly policy?: RequestPolicy;` | optional | Cache, dedupe and retry, as `createJsonDataSource`. |
| `scheduler` | `readonly scheduler?: Scheduler;` | optional |  |
| `onRequest` | `readonly onRequest?: (event: PivotRequestEvent) => boolean \| void;` | optional | Called before every request; `return false` cancels it (`RequestCanceledError`). Mutate nothing: replace through `transport`. |
| `onResponse` | `readonly onResponse?: (event: PivotResponseEvent) => WireAnyResponse \| void;` | optional | Called with every successful response; returning an object replaces it. |
| `onError` | `readonly onError?: (event: PivotRequestErrorEvent) => void;` | optional |  |
