Class ObservableProjectsClient

Observable version of the ProjectsClient. All methods return RxJS Observables instead of Promises.

client.projects.list().subscribe(projects => {
console.log('Available projects:', projects)
})

Constructors

Methods

Constructors

Methods

  • Fetch a project by project ID

    Parameters

    • projectId: string

      ID of the project to fetch

    Returns Observable<SanityProject>

  • Fetch a list of projects the authenticated user has access to.

    Parameters

    • Optionaloptions: { includeMembers?: true }

      Options for the list request

      • OptionalincludeMembers?: true

        Whether to include members in the response (default: true)

    Returns Observable<SanityProject[]>

  • Fetch a list of projects the authenticated user has access to.

    Parameters

    • Optionaloptions: { includeMembers?: false }

      Options for the list request

      • OptionalincludeMembers?: false

        Whether to include members in the response (default: true)

    Returns Observable<Omit<SanityProject, "members">[]>