@usethrottle/cart
    Preparing search index...

    Class CartSessionClient

    Index
    • get cartSessionId(): string | null

      The current bound session id (after create()/resume()), or null.

      Returns string | null

    • The Throttle-hosted cart page for this session. Send a buyer here to let Throttle run the cart UI instead of building one.

      Parameters

      • baseUrl: string = 'https://checkout.usethrottle.dev'

      Returns string

    • Bind to an existing session id — e.g. one restored from localStorage.

      Parameters

      • cartSessionId: string

      Returns this

    • Bind to an existing session without a publishable token.

      create() needs a quote token; every other route is authorized by the opaque cart_… id alone. A caller that only ever resumes — Throttle's own hosted cart page, or a storefront restoring from localStorage — would otherwise have to invent a token to satisfy the constructor.

      Parameters

      • cartSessionId: string
      • opts: {
            baseUrl?: string;
            fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
            origin?: string;
            timeoutMs?: number;
        } = {}
        • OptionalbaseUrl?: string
        • Optionalfetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>
        • Optionalorigin?: string
        • OptionaltimeoutMs?: number

      Returns CartSessionClient