jira.js
    Preparing search index...

    Function getTenantContext

    • Resolves the site's cloudId, orgId and host name.

      Atlassian publishes no REST endpoint for these — the GraphQL gateway is the documented way to ask, and an API token is one of the auth categories it accepts. One request, through the client you already built, so it inherits its proxy, retry policy and custom fetch.

      import { createClient, getTenantContext } from 'jira.js/core';

      const client = createClient({ host: 'https://your-domain.atlassian.net', auth });
      const { orgId } = await getTenantContext(client);

      Cloud only, and not under OAuth 2.0 (3LO): the gateway lives on the site's own host, which a 3LO client does not have. A Data Center host does not serve it at all.

      Parameters

      Returns Promise<TenantContext>