Sanity Library Reference Docs
    Preparing search index...

    Declares every topic available through the message bus.

    interface Topics {
        "applications.config": StateTopicDef<ApplicationConfig[] | null>;
        "applications.foreground": StateTopicDef<string | null>;
        "applications.list": StateTopicDef<
            TopicResult<Application<ApplicationInclude>[]>
            | null,
        >;
        "auth.token": StateTopicDef<string | null>;
        "auth.token.refresh": EventTopicDef<void, string>;
        "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<
            Pick<CurrentUser, "name" | "id" | "email" | "profileImage">
            | null,
        >;
    }

    Hierarchy (View Summary)

    Index

    Properties

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

    The available application configuration modules.

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

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

    "applications.list": StateTopicDef<
        TopicResult<Application<ApplicationInclude>[]>
        | null,
    >

    The dashboard applications available to the current user.

    "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.

    "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<
        Pick<CurrentUser, "name" | "id" | "email" | "profileImage">
        | null,
    >

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