Sanity Library Reference Docs
    Preparing search index...

    Variable useApplicationConst

    useApplication: <Include extends ApplicationInclude = never>(
        applicationIdOrSlug: string,
        options?: { include?: Include[]; organizationId?: string },
    ) => FetcherHookResult<Application<Include>> = ...

    Returns a single application by id or slug.

    The hook suspends until the first fetch succeeds, so data is always present. The include tokens you pass shape data: each requested token adds its field, and omitted ones are absent from the type.

    Type declaration

      • <Include extends ApplicationInclude = never>(
            applicationIdOrSlug: string,
            options?: { include?: Include[]; organizationId?: string },
        ): FetcherHookResult<Application<Include>>
      • Type Parameters

        Parameters

        • applicationIdOrSlug: string

          The application id, or its slug when organizationId is set.

        • Optionaloptions: { include?: Include[]; organizationId?: string }

          Optional include list to expand related resources, and the organizationId the application belongs to. A slug needs it, since a slug is only unique within an organization.

        Returns FetcherHookResult<Application<Include>>

        The result envelope {data, isFetching, error, refetch}.