Sanity Library Reference Docs
    Preparing search index...

    Interface StudioWorkspaceHandle

    Minimal duck-typed interface representing a Sanity Studio workspace. The Studio's Workspace type satisfies this naturally — no import dependency on the sanity package is required.

    interface StudioWorkspaceHandle {
        auth: { token?: TokenSource };
        dataset: string;
        projectId: string;
    }
    Index

    Properties

    auth: { token?: TokenSource }

    Authentication state for this workspace.

    Type declaration

    • Optionaltoken?: TokenSource

      Reactive token source from the Studio's auth store. When present, the SDK subscribes for ongoing token sync — the Studio is the single authority for auth and handles token refresh.

      Optional because Studios before Aug 2022 may not expose it. When absent, the SDK falls back to localStorage/cookie discovery.

    dataset: string

    The dataset name for this workspace.

    projectId: string

    The Sanity project ID for this workspace.