@salesforce/b2c-tooling-sdk / clients / normalizeTenantId
Function: normalizeTenantId()
normalizeTenantId(
value):string
Defined in: packages/b2c-tooling-sdk/src/clients/custom-apis.ts:207
Normalizes any parseable tenant/organization ID form to the canonical underscore format.
Supported input forms (all resolve to abcd_123):
abcd_123— canonical tenant ID (returned as-is)abcd-123— hyphenated tenant IDf_ecom_abcd_123— organization IDf_ecom_abcd-123— org ID with hyphenated tenantabcd-123.dx.commercecloud.salesforce.com— sandbox hostname
Parameters
value
string
The tenant ID, organization ID, or hostname
Returns
string
The normalized tenant ID in canonical underscore format (e.g., "abcd_123")
Example
ts
normalizeTenantId('f_ecom_zzxy_prd') // Returns 'zzxy_prd'
normalizeTenantId('zzxy-prd') // Returns 'zzxy_prd'
normalizeTenantId('zzxy-prd.dx.commercecloud.salesforce.com') // Returns 'zzxy_prd'