activateDomain
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
| Param | Type | Notes | Description |
|---|---|---|---|
credentials | FlowstackCredentials | required | The app owner's credentials (owner-scoped JWT). |
siteId | string | required | The site/app id to operate on. |
domain | string | required | The custom domain, e.g. app.example.com. |
config | FlowstackClientConfig | since 0.2.8 | Client config (baseUrl, appScope, tenantId as needed). |
Returns
| Field | Type | Description |
|---|---|---|
| — | 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.