Hooksbase SDKs

Hooksbase ships one first-party SDK today: @hooksbase/sdk for TypeScript and modern JavaScript runtimes. Everything else in the docs should be read as raw HTTP guidance or language-specific reference snippets, not as first-party maintained clients.

Client surfaces

TypeScript SDK

The first-party client for project APIs, Automations, ingest publishing, pagination helpers, and signature verification.

Read more

CLI

The first-party command-line surface for profiles, webhooks, Automations, deliveries, replay, DLQ, schedules, event drains, operator alerting, files, and ingest sends.

Read more

Raw HTTP

Use cURL or your own client for browser/raw surfaces, non-TypeScript runtimes, and HTTP-level contract checks.

Read more

Language snippets

Python, Ruby, Go, and PHP examples in these docs are reference snippets, not first-party client libraries.

Read more

TypeScript SDK

The SDK covers the core Public API routes and helper flows:

  • client.projectsgetCurrent(), update()
  • client.apiKeyslist(), create(), get(), revoke(), rotate()
  • client.auditLogslist(), get()
  • client.httpPackslist()
  • client.templateslist()
  • client.webhookslist(), get(), create(), update(), destination helpers, routing helpers, transform helpers, listDeliveries(), metrics, backlog, email allowlists, testDelivery(), pause(), resume(), archive(), restore(), destroy(), rotateIngestSecret(), rotateSigningSecret(), listSecretVersions()
  • client.automationslist(), create(), get(), update(), version helpers, lifecycle helpers, test runs, webhook binding helpers, and Enterprise egress attachment
  • client.automationRunslist(), get(), getLogs(), getEgressEvents(), export()
  • client.automationTemplates, client.automationQuotas, client.automationBillingUsage, and client.automationEgressPolicies
  • client.scheduleslist(), create(), pause(), resume(), delete()
  • client.deliverieslist(), get(), replay(), listReplayJobs(), bulkReplay()
  • client.replayJobsget()
  • client.bulkOperationsget()
  • client.dlqlist(), get(), redrive(), export(), bulkRedrive()
  • client.usageget({ from, to, webhookId? })
  • client.eventDrainslist(), create(), get(), update(), pause(), resume(), delete()
  • client.filesdownloadSignedUrl(), downloadDeliveryFile()
  • client.operatorWebhooks, client.alertChannels, client.alertRules, and client.operatorIncidents for operator alerting
  • client.ingestpublishJson(), publishBytes(), publishJsonByWebhookName(), publishBytesByWebhookName()
  • verifyHooksbaseWebhook() for outbound signature verification
  • paginateCursor() and takePages() for cursor pagination
  • typed errors such as HooksbaseApiError, HooksbaseAuthError, HooksbaseRateLimitError, HooksbaseNetworkError, and HooksbaseTimeoutError

Create a client

import { createHooksbaseClient } from '@hooksbase/sdk'

const client = createHooksbaseClient({
  apiKey: process.env.HOOKSBASE_API_KEY,
})

createHooksbaseClient() accepts:

  • apiKey — project API key (swk_...)
  • baseUrl — defaults to https://api.hooksbase.com
  • timeoutMs — per-request timeout, defaults to 10000
  • retryCount — idempotent retry count on transient failures, defaults to 2
  • userAgent — optional override for the outbound User-Agent header
  • fetch — optional fetch implementation for testing or non-standard runtimes

Create an Automation with Code Mode

const created = await client.automations.create({
  webhookId: 'wh_123',
  name: 'Normalize agent event',
  type: 'transform',
})

await client.automations.createVersion(created.automation.id, {
  code: 'export async function run(input) { return { type: "dispatch", body: input.source.payload } }',
})

await client.automations.test(created.automation.id, {
  payload: { provider: 'stripe', type: 'invoice.payment_failed' },
  waitForSettlementMs: 3000,
})

Raw and dashboard-only surfaces

Form ingest remains browser/raw HTTP only: use GET/POST /v1/form/{publicId} directly when embedding public forms. The SDK also does not wrap session-authenticated dashboard workflows such as project creation, team invites, billing checkout, onboarding wizard state, or browser-only UI traffic.

See raw HTTP examples when you need copy-ready HTTP requests for the underlying routes, even when an SDK helper also exists.

Common mistakes

  • Treating Python, Ruby, Go, or PHP snippets in the docs as official SDKs.
  • Assuming the SDK wraps dashboard-only product flows. The dashboard is a UI and is not exposed as a public API surface.
  • Expecting form-ingest-specific helpers. Form ingest is intentionally browser or raw HTTP today.
  • Using raw HTTP examples from old docs that still reference removed prefixes instead of current swk_... and whsec_... values.
  • Assuming SDK coverage and public API coverage are the same. Check the Public API reference and this page together.

Was this page helpful?