Skip to main content
Every field createClient(opts) accepts. Same as the exported ClientOptions TypeScript type.

Required

tenant: string

Workspace id (t_…) the client acts under. Can be read from NORA_TENANT env if omitted.

Credentials

token?: string

PAT (nora_pat_…) for management calls. Read from NORA_PAT env if omitted. Not required if you only call the trigger-secret surfaces (flows.run, feedback, signals.report).

triggerSecret?: string

Per-Flow execution secret. Read from NORA_TRIGGER_SECRET env if omitted. Required for flows.run and signals.report.

triggerHeader?: string

Header the trigger expects its secret on. Matches the trigger block’s configured api_auth_header. Defaults to authorization sent as Bearer <secret>. Override when your trigger is configured to accept a non-standard header:

Transport

baseUrl?: string

Server base URL. Defaults to https://platform.nora.my/api/v1 (or NORA_BASE_URL env if set). Override for self-hosted / staging deployments:

timeoutMs?: number

Per-call default timeout in milliseconds. Default 30_000 (30 s). Individual verbs can override with a timeoutMs in their own options object (e.g. flows.run(slug, input, { timeoutMs: 60_000 })).

maxRetries?: number

Retry count for server-declared-retryable failures (NoraProviderError and NoraPlatformError when .retryable === true). Default 2. Every attempt is logged with attempt and the failure code — no silent retries. See Errors · Logging. Set to 0 to disable SDK-layer retry (do your own at the application layer):

fetchImpl?: typeof fetch

Custom fetch implementation. Defaults to globalThis.fetch. Use this for:
  • Test seams — inject a mock:
  • Custom runtimes — Node with undici, edge workers with a specific fetch polyfill, HTTP proxy shims.
Signature must match the standard fetch(input, init?).

Observability

logger?: Logger

Structured logger the SDK pipes internal records into. Compatible with pino, winston, bunyan, or anything matching:
The SDK redacts by default — tokens, secrets, onBehalfOf values, and request/response bodies do not appear in logs unless debug: true.

debug?: boolean

When true, request and response bodies get logged (via the logger). Off by default. Turn on per-incident only, ideally via a scoped clone rather than the shared client. Bodies can contain PII.

onLog?: (event: LogEvent) => void

Observe SDK-internal events for metrics — request / response / retry / error. Event shape:
Never carries secrets or request bodies — safe to ship to any metrics sink. Wire it to your metrics stack:
Retry rate, fallback frequency, and circuit-open rate are leading indicators when something upstream is degrading.

Full example

See also

  • Auth — credentials + PAT scopes.
  • Errors — how transport failures surface and which retry logic applies.