createClient
Create an authenticated Acme API client for REST and resource helpers.
createClient
Creates an authenticated Acme API client.
createClientcreateClient(options: ClientOptions): ClientParameters#
| Parameter | Type | Description |
|---|---|---|
apiKey * | string | Secret API key from the Acme dashboard. |
baseUrl | string | Override the API base URL. Default: https://api.acme.dev. |
timeout | number | Request timeout in ms. Default: 30000. |
Returns#
Client — an object with resource namespaces (users, projects, webhooks).
Example#
import { createClient } from "@acme/client";
const client = createClient({ apiKey: process.env.ACME_API_KEY! });
await client.ping();Errors#
| Code | Status | When |
| ----------------- | ------ | ------------------------------- |
| invalid_api_key | 401 | API key is missing or revoked |
| rate_limited | 429 | Too many requests in the window |