Sanity Library Reference Docs
    Preparing search index...

    Interface ContentAgentProviderSettings

    Settings for creating a Content Agent provider instance via createContentAgent.

    import { createContentAgent } from 'content-agent'

    const contentAgent = createContentAgent({
    organizationId: 'your-org-id',
    token: 'your-sanity-token',
    // Optional overrides:
    // baseURL: 'https://api.sanity.io',
    // apiVersion: 'v2026-01-01',
    })
    interface ContentAgentProviderSettings {
        apiVersion?: string;
        baseURL?: string;
        fetch?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        };
        headers?: Record<string, string>;
        organizationId: string;
        token?: string;
    }
    Index

    Properties

    apiVersion?: string

    API version to use for requests. Should be in format 'vYYYY-MM-DD' (e.g., 'v2026-01-01').

    'v2026-01-01'
    
    baseURL?: string

    Base URL for the Sanity API.

    'https://api.sanity.io'
    
    fetch?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: string | URL | Request, init?: RequestInit): Promise<Response>;
    }

    Custom fetch implementation. Useful for testing or adding middleware.

    Type declaration

      • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
      • Parameters

        • input: URL | RequestInfo
        • Optionalinit: RequestInit

        Returns Promise<Response>

      • (input: string | URL | Request, init?: RequestInit): Promise<Response>
      • Parameters

        • input: string | URL | Request
        • Optionalinit: RequestInit

        Returns Promise<Response>

    headers?: Record<string, string>

    Custom headers to include in requests.

    organizationId: string

    Your Sanity organization ID.

    token?: string

    Authentication token for the Sanity API. If not provided, requests will be made without authentication (useful for browser contexts where auth may come from cookies).