Sanity Library Reference Docs
    Preparing search index...

    Declares the topics provided by the dashboard.

    interface DashboardTopics {
        "access.request": EventTopicDef<
            { resourceId: string; resourceType: "organization"
            | "project" },
            { ok: true } | { ok: false; reason: "unsupported" | "already-has-access" },
        >;
        "applications.activity": EventTopicDef<DocumentActivity>;
        "applications.base-path": StateTopicDef<TopicResult<string>>;
        "applications.capabilities": StateTopicDef<
            Partial<Record<"history" | "globalUserMenu" | "favorites", boolean>>,
        >;
        "applications.config": StateTopicDef<ApplicationConfig[] | null>;
        "applications.context": StateTopicDef<
            ApplicationContext & { appId: string }
            | null,
        >;
        "applications.context.update": EventTopicDef<ApplicationContext | null>;
        "applications.foreground": StateTopicDef<string | null>;
        "applications.list": StateTopicDef<
            | TopicResult<
                (
                    | Installation<InstallationInclude>
                    | Application<ApplicationInclude>
                    | LocalApplication
                )[],
            >
            | null,
        >;
        "applications.status.update": EventTopicDef<ApplicationStatusUpdate>;
        "auth.token": StateTopicDef<string | null>;
        "auth.token.refresh": EventTopicDef<void, string>;
        "favorites.documents": StateTopicDef<
            {
                id: string;
                resource: {
                    id: string;
                    schemaName?: string;
                    type: "dataset"
                    | "media-library"
                    | "canvas";
                };
                type: string;
            }[],
        >;
        "favorites.update": EventTopicDef<
            {
                document: {
                    id: string;
                    resource: {
                        id: string;
                        schemaName?: string;
                        type: "dataset"
                        | "media-library"
                        | "canvas";
                    };
                    type: string;
                };
                favorited: boolean;
            },
            void,
        >;
        "navigation.location": StateTopicDef<NavigationLocation | null>;
        "navigation.location.update": EventTopicDef<
            { history?: "push"
            | "replace"; url: string },

                | { ok: true }
                | { ok: false; reason: "not-navigable" | "interrupted" | "failed" },
        >;
        "organizations.current": StateTopicDef<
            Pick<OrganizationBase, "name" | "id" | "slug">
            | null,
        >;
        "panels.mode": StateTopicDef<
            | TopicResult<
                | { appId: string; mode: "aside"; name: string; size?: number }
                | { appId: string; mode: "full"; name: string }
                | null,
            >
            | null,
        >;
        "panels.mode.set": EventTopicDef<
            | { mode: "aside"
            | "full"; name: string }
            | { name: string; size: number }
            | null,
        >;
        "preferences.color-scheme": StateTopicDef<"light" | "dark">;
        "preferences.dock-locked": StateTopicDef<boolean>;
        "users.current": StateTopicDef<CurrentUser | null>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    "access.request": EventTopicDef<
        { resourceId: string; resourceType: "organization"
        | "project" },
        { ok: true } | { ok: false; reason: "unsupported" | "already-has-access" },
    >

    Asks the dashboard to show its access request prompt for a resource the user can't access, scoped like the Access API's /access/{resourceType}/{resourceId}/requests. Replies once the prompt is shown. The prompt handles the Access API outcome (SSO enforcement, pending or declined requests, request limits), so the reply doesn't report it.

    ok: false reasons:

    • unsupported: the dashboard doesn't show access requests for the sending application
    • already-has-access: the user already has access to the resource, so there is nothing to request
    "applications.activity": EventTopicDef<DocumentActivity>

    Reports user activity in an application, e.g. for the recents feed. Fire-and-forget.

    "applications.base-path": StateTopicDef<TopicResult<string>>

    The base path for an application.

    An unknown application returns {ok: false}.

    "applications.capabilities": StateTopicDef<
        Partial<Record<"history" | "globalUserMenu" | "favorites", boolean>>,
    >

    The capabilities the host provides. A missing key means the host does not provide it.

    "applications.config": StateTopicDef<ApplicationConfig[] | null>

    The available application configuration modules.

    "applications.context": StateTopicDef<
        ApplicationContext & { appId: string }
        | null,
    >

    The foreground application's context, or null when it has published none.

    "applications.context.update": EventTopicDef<ApplicationContext | null>

    Publishes the sending application's context. null clears it. Fire-and-forget.

    "applications.foreground": StateTopicDef<string | null>

    The foreground application ID, or null on dashboard-level routes.

    "applications.list": StateTopicDef<
        | TopicResult<
            (
                | Installation<InstallationInclude>
                | Application<ApplicationInclude>
                | LocalApplication
            )[],
        >
        | null,
    >

    The dashboard applications and installations available to the current user. Each member publishes its own raw serialised record, so the kinds are distinguished by shape: an Application has a type of 'studio' | 'coreApp', a LocalApplication adds local, and an Installation has no type and carries applicationId with a nested application object.

    "applications.status.update": EventTopicDef<ApplicationStatusUpdate>
    "auth.token": StateTopicDef<string | null>

    The session token for the reading connection, or null while signed out. The host writes it to each connection separately, so one application never sees another's token.

    "auth.token.refresh": EventTopicDef<void, string>

    Requests a dashboard session token.

    "favorites.documents": StateTopicDef<
        {
            id: string;
            resource: {
                id: string;
                schemaName?: string;
                type: "dataset"
                | "media-library"
                | "canvas";
            };
            type: string;
        }[],
    >

    The signed-in user's favorited documents, published while the host provides favorites.

    "favorites.update": EventTopicDef<
        {
            document: {
                id: string;
                resource: {
                    id: string;
                    schemaName?: string;
                    type: "dataset"
                    | "media-library"
                    | "canvas";
                };
                type: string;
            };
            favorited: boolean;
        },
        void,
    >

    Favorites or unfavorites a document. The host replies once favorites.documents reflects the change, so a read after the reply sees it. A favorite is identified by its published document ID, type, resource and schemaName (workspace).

    "navigation.location": StateTopicDef<NavigationLocation | null>

    The current dashboard location and active navigation.

    "navigation.location.update": EventTopicDef<
        { history?: "push"
        | "replace"; url: string },

            | { ok: true }
            | { ok: false; reason: "not-navigable" | "interrupted" | "failed" },
    >

    Requests navigation and replies when the location commits.

    ok: false reasons:

    • not-navigable: the URL cannot be handled by a dashboard application
    • interrupted: another navigation superseded the request
    • failed: the router rejected or did not commit the request
    "organizations.current": StateTopicDef<
        Pick<OrganizationBase, "name" | "id" | "slug">
        | null,
    >

    The current organization, or null without an active organization.

    "panels.mode": StateTopicDef<
        | TopicResult<
            | { appId: string; mode: "aside"; name: string; size?: number }
            | { appId: string; mode: "full"; name: string }
            | null,
        >
        | null,
    >

    The open panel, its application, display mode, and optional width in pixels.

    "panels.mode.set": EventTopicDef<
        | { mode: "aside"
        | "full"; name: string }
        | { name: string; size: number }
        | null,
    >

    Opens, updates, resizes, or closes an application's panel.

    "preferences.color-scheme": StateTopicDef<"light" | "dark">

    The resolved dashboard color scheme.

    "preferences.dock-locked": StateTopicDef<boolean>

    Whether the dashboard dock is pinned open.

    "users.current": StateTopicDef<CurrentUser | null>

    The signed-in user, or null while signed out.