Rovenue Web SDK
    Preparing search index...

    Interface RovenueOptions

    interface RovenueOptions {
        apiKey: string;
        apiUrl: string;
        fetchImpl?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        };
        storage?: SdkStorage;
    }
    Index
    apiKey: string

    The project's PUBLIC api key. Visible in the browser by design.

    apiUrl: string

    Base URL of the Rovenue API, without a trailing path.

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

    Injected for tests and for hosts that wrap fetch.

    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>

    storage?: SdkStorage

    Where the rovenueId, the entitlement cache and the event queue persist.

    Defaults to createStorage, which uses localStorage where it works and falls back to memory where it does not — including during server rendering. Defaulting to memory instead would silently mint a new subscriber on every page load, orphaning the cache and the queue with it, and would only be correct for developers who read the docs.