Rovenue Web SDK
    Preparing search index...

    Interface Rovenue

    interface Rovenue {
        http: HttpClient;
        identity: Identity;
        checkout(
            input: {
                cancelUrl: string;
                idempotencyKey?: string;
                offeringIdentifier: string;
                packageIdentifier: string;
                successUrl: string;
            },
        ): Promise<CheckoutResult>;
        flushEvents(): Promise<void>;
        getCachedEntitlements(): Record<string, unknown> | null;
        getCachedEntitlementsEntry(): CachedEntitlements | null;
        getEntitlements(): Promise<Record<string, unknown>>;
        getOfferings(): Promise<WebOfferingsResponse>;
        getPlacement(identifier: string): Promise<unknown>;
        identify(appUserId: string): void;
        logOut(): Promise<void>;
        recordExposure(
            input: {
                experimentId: string;
                placementId?: string;
                variantId: string;
            },
        ): Promise<void>;
        rovenueId(): string;
        startEventQueue(): void;
        stopEventQueue(): void;
        track(input: TrackInput): void;
    }
    Index
    http: HttpClient

    Escape hatch for endpoints without a typed wrapper yet.

    identity: Identity
    • Starts a Stripe Checkout and returns the URL to send the browser to.

      The caller names a package, never a price: the amount is resolved server-side from the offering, so a page that lies about what something costs changes nothing about what is charged.

      Redirect URLs must be on one of the key's allowed origins (exact scheme, host and port) or a verified custom domain over https.

      Parameters

      • input: {
            cancelUrl: string;
            idempotencyKey?: string;
            offeringIdentifier: string;
            packageIdentifier: string;
            successUrl: string;
        }

      Returns Promise<CheckoutResult>

    • Attempts every queued event once. Called automatically on unload.

      Returns Promise<void>

    • Last-known entitlements, or null if nothing has been fetched yet.

      Synchronous and network-free, so a first paint can render the truth the server gave last time instead of a flash of the paywall a subscriber has already paid to remove. It is a cache, never an authorization decision: the storage behind it is viewer-editable.

      Returns Record<string, unknown> | null

    • Returns Promise<Record<string, unknown>>

    • Parameters

      • identifier: string

      Returns Promise<unknown>

    • Client-local. Merging subscribers is a server-side, secret-key operation.

      Parameters

      • appUserId: string

      Returns void

    • Flushes queued events under the current identity, then rotates it.

      Returns Promise<void>

    • Records that a subscriber was shown an experiment variant.

      Assignment alone is invisible to the analytics: a visitor bucketed into an arm but missing from exposure_events still contributes revenue while being absent from the denominator, which biases conversion rates and breaks the sample-ratio check. The native path fires this immediately after the draw; so does the web one.

      Parameters

      • input: { experimentId: string; placementId?: string; variantId: string }

      Returns Promise<void>

    • The wire identity for this browser.

      Returns string

    • Registers the unload listeners that flush queued events.

      Not called by configure(): configure() also runs during server rendering, where there is nothing to listen to. The React provider calls this in an effect; a non-React host calls it once after construction.

      Returns void

    • Returns void

    • Queues an event for at-least-once delivery.

      Returns immediately: the event is persisted and sent by the queue, which retries across page loads and flushes when the tab is hidden or closing.

      Parameters

      Returns void