Options accepted by PortalCompat.

interface PortalCompatOptions {
    apiKey?: string;
    fetchFn?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: string | URL | Request, init?: RequestInit): Promise<Response>;
    };
    portalUrl?: string;
    token?: string;
}

Properties

apiKey?: string

Static API key (falls back to esriConfig.apiKey).

fetchFn?: {
    (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
    (input: string | URL | Request, init?: RequestInit): Promise<Response>;
}

Override the global fetch implementation (useful in tests).

Type declaration

    • (input, init?): Promise<Response>
    • Parameters

      • input: URL | RequestInfo
      • Optionalinit: RequestInit

      Returns Promise<Response>

    • (input, init?): Promise<Response>
    • Parameters

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

      Returns Promise<Response>

portalUrl?: string

Portal base URL. Accepts either a portal root (https://portal.example) or a /sharing/rest base; both normalize to the .../sharing/rest endpoint base. Defaults to esriConfig.portalUrl.

token?: string

Pre-obtained token to attach to authenticated calls.