Sanity Library Reference Docs
    Preparing search index...

    Interface TokenSource

    A minimal Observable-compatible interface for subscribing to token changes. Any object with a subscribe method that follows this contract will work, including RxJS Observables. This avoids coupling the SDK to a specific reactive library.

    interface TokenSource {
        subscribe(
            observer: { next: (token: string | null) => void },
        ): { unsubscribe(): void };
    }
    Index

    Methods

    Methods

    • Subscribe to token emissions. Emits null when logged out.

      Parameters

      • observer: { next: (token: string | null) => void }

      Returns { unsubscribe(): void }