Adspire.AI Node SDK
The Adspire.AI Node SDK provides a simple, type‑safe client for the REST API.
Features
- Auto‑generated TypeScript client for Adspire.AI’s REST API
- Built on
@hey-api/client-fetch - Type‑safe API calls (auto‑generated types)
- Configurable base URL and environment settings
Installation
npm install @adspireai/adspire-node-sdk
Usage
The SDK exports all generated methods from the OpenAPI spec.
import { createWebhookEvent } from "@adspireai/adspire-node-sdk";
import { client } from "@adspireai/adspire-node-sdk/dist/client.gen";
client.setConfig({
baseUrl: "https://api.adspire.ai",
headers: {
Accept: "application/json",
Authorization: `Bearer ${process.env.CONNECTOR_API_TOKEN}`,
},
});
await createWebhookEvent({
client,
body: {
event_type: "provider.topic",
payload: {
example: true,
},
},
});
Development and regeneration
The SDK is generated from the OpenAPI spec using @hey-api/openapi-ts.
Environment setup
Copy the example env file and edit as needed:
npm run setup
The .env file includes:
OPENAPI_SPEC=https://api.adspire.ai/api/docs
Scripts
npm run setup– Copiesenv.exampleto.envnpm run generate– Regenerates the SDK from the OpenAPI specnpm run build– Compiles the TypeScript SDK todist/src
Regenerate after API changes
npm run generate
npm run build
Only the compiled SDK (dist/src) is published to npm.