Skip to content

[Client SDK]: Content API should include client siteId by default #33304

@KevinDavilaDotCMS

Description

@KevinDavilaDotCMS

Task Title

[Client SDK]: Content API should include client siteId by default

Description

When making a query using the Content API, it does not take into account the siteId initialized in the client.
It should be considered by default.

client = createDotCMSClient({ auth: XXX, siteId: SITE_ID })

client.content.getCollection('Blog')

Queries should internally use: +conhost:SITE_ID, where SITE_ID is the one provided in the client configuration.

This behavior must be transparent to the user.

The user should still be able to override this siteId, meaning they can provide a different siteId as part of the query. In that case, the original siteId must be replaced by the one sent by the user.

Acceptance Criteria

  • [] Content API queries include, by default, the siteId provided during client creation.
  • [] The user can override the siteId when making a query.

Priority

Medium

Additional Context

https://dotcms.slack.com/archives/C08DV95V4HG/p1758134448054179

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions