@faable/auth-js - v1.7.4
    Preparing search index...

    Function cookieStorageAdapter

    • Storage adapter that persists the session in document.cookie.

      Pick this adapter when you need SSR (server reads the cookie on every request) or want to scope storage with Secure, SameSite, or Domain. The simplest way to enable it is createClient({ storage: 'cookie' }) or by passing cookieOptions — the SDK calls this factory internally.

      Defaults applied to every cookie: Path=/, SameSite=Lax, Secure on HTTPS, 30-day Max-Age. Override any of them through options. Values larger than the per-cookie browser limit (~4 KB) are transparently split across numbered chunks (<key>.0, <key>.1, …) and re-assembled on read.

      Parameters

      • options: CookieAttributes = {}

        Attribute overrides for every written cookie.

      • jar: CookieJar | null = ...

        Document-like object whose cookie property is read/written. Defaults to document in browsers and null (no-op) on the server — only override for tests.

      Returns SupportedStorage

      A SupportedStorage ready to pass to createClient.

      import { createClient } from '@faable/auth-js'

      export const auth = createClient({
      domain: '<faableauth_domain>',
      clientId: '<client_id>',
      storage: 'cookie',
      cookieOptions: { domain: '.example.com' }
      })