Skip to main content

TypeScript example

The following example uses the standard fetch API. Run this code only in a trusted server-side environment. Do not expose THE_WO_API_KEY in browser or mobile application bundles.

Environment variables

Use the API base URL assigned to your environment by The Wo. A public production hostname is not documented until that environment is available.

Example

Important integration rules

Keep the API key server-side. Use error.code for programmatic error handling instead of matching the human-readable message. Keep error.requestId when reporting failed requests. Do not assume that a failed create request can always be retried idempotently.

Example quota handling

Applications may handle monthly quota exhaustion explicitly:
See Errors and Usage and quotas for the complete behavior.