searchDomains
Client function: check domain availability + Casino retail pricing across TLDs (P0-163).
import { searchDomains } from 'flowstack-sdk'Non-React client function. Checks availability and Casino retail pricing (markup included) for a name across one or more TLDs. GET /api/v1/registrar/check?name={name}&tlds={tlds}. This is the search half of the registrar buy plane — pair it with purchaseDomain to complete a purchase, or with connectDomain if the user already owns the domain elsewhere.
Signature
searchDomains(credentials, name, tlds?, config?): Promise<ApiResponse<{ results: DomainSearchResult[]; degraded?: boolean }>>Parameters
| Param | Type | Notes | Description |
|---|---|---|---|
credentials | FlowstackCredentials | required | The builder's credentials (owner-scoped JWT). |
name | string | required | The name to check, without TLD — e.g. thezengarden. |
tlds | string | — | Comma-separated TLDs to check, e.g. com,dev,app. Omit for the default set. |
config | FlowstackClientConfig | — | Client config (baseUrl, appScope, tenantId as needed). |
Returns
| Field | Type | Description |
|---|---|---|
| — | Promise<ApiResponse<{ results: DomainSearchResult[]; degraded?: boolean }>> | One DomainSearchResult per TLD checked. degraded: true means every lookup failed (registrar outage). |
Examples
Check a name across TLDs
const res = await searchDomains(credentials, 'thezengarden', 'com,dev,app');
if (res.data?.degraded) {
showError('Domain search is temporarily unavailable — try again shortly.');
} else {
for (const r of res.data.results) {
if (r.available) console.log(`${r.domain} — $${r.price_usd}/yr`);
}
}Warning
degraded: true means every lookup failed (registrar outage) — show an error state, NOT "taken". Per-TLD, available: null means that single lookup failed; only available: false means the domain is actually taken.WarningOwner/management operation — call it with the builder's credentials from a dashboard/builder context, not from inside the generated app's end-user runtime.
builtAppSafe is false.See also
purchaseDomain · DomainSearchResult · connectDomain · listDomains
Source: src/api/client.ts (Domain Registrar, P0-163) · Also available in llms-full.txt and registry.json.