Docs / built-apps / activateDomain

activateDomain

utilitysince 0.2.8not for built apps

Client function: activate a domain once its ACM cert is issued (CloudFront goes live ~5–15 min after).

import { activateDomain } from 'flowstack-sdk'

Non-React client function. Call after getDomainStatus reports status: "issued". POST /api/v1/apps/{siteId}/domains/{domain}/activate.

Signature

activateDomain(credentials, siteId, domain, config?): Promise<ApiResponse<ActivateDomainResult>>

Parameters

ParamTypeNotesDescription
credentialsFlowstackCredentialsrequiredThe app owner's credentials (owner-scoped JWT).
siteIdstringrequiredThe site/app id to operate on.
domainstringrequiredThe custom domain, e.g. app.example.com.
configFlowstackClientConfigsince 0.2.8Client config (baseUrl, appScope, tenantId as needed).

Returns

FieldTypeDescription
Promise<ApiResponse<ActivateDomainResult>>ActivateDomainResult: { domain, site_id, status: "live", url, message }.

Examples

Activate
const res = await activateDomain(credentials, siteId, 'app.example.com', { appScope });
if (res.ok) console.log('live at', res.data.url);
NoteThe cert must be issued first (see getDomainStatus). After activation CloudFront propagation takes ~5–15 minutes before the domain serves.
WarningOwner/management operation — call it with the app owner's credentials from a builder/dashboard/server context, not from inside the generated app's end-user runtime. builtAppSafe is false.

See also

getDomainStatus · connectDomain

Source: src/api/client.ts (Custom Domains, P0-158) · Also available in llms-full.txt and registry.json.