update()
Updates a domain for the instance. Both primary and satellite domains can be updated. If you choose to use Clerk via proxy, use this endpoint to specify the proxy_url. Whenever you decide you'd rather switch to DNS setup for Clerk, simply set proxy_url to null for the domain.
When you update a production instance's primary domain name, you have to make sure that you've completed all the necessary setup steps for DNS and emails to work. Expect downtime otherwise. Updating a primary domain's name will also update the instance's home origin, affecting the default application paths.
Returns the updated Domain object.
function update(params: UpdateDomainParams): Promise<Domain>- Name
domainId- Type
string- Description
The ID of the domain that will be updated.
- Name
is_secondary?- Type
boolean | null- Description
Whether this is a domain for a secondary app, meaning that any subdomain provided is significant and will be stored as part of the domain. This is useful for supporting multiple apps (one primary and multiple secondaries) on the same root domain (eTLD+1).
const response = await clerkClient.domains.update({
domainId: 'domain_123',
is_secondary: true,
})Backend API (BAPI) endpoint
This method in the SDK is a wrapper around the BAPI endpoint PATCH/domains/{domain_id}. See the BAPI reference for more information.
Feedback
Last updated on