TypeScript SDK

Typed client for the Public and Admin APIs, plus webhook verification.

npm install @konecto/sdk
import { Konecto } from '@konecto/sdk';

// Browser: publishable key, Public API only
const pub = new Konecto({ publishableKey: 'pk_live_...' });
const event = await pub.events.get('acme-summit');
const types = await pub.ticketTypes.list(event.slug);
const { url } = await pub.checkout.create({ event: event.slug, items: [{ ticket_type: types[0].id, quantity: 2 }] });

// Server: secret key, Admin API
const admin = new Konecto({ secretKey: process.env.KONECTO_SECRET_KEY });
const ev = await admin.events.create({ name: 'Acme Summit', kind: 'conference', starts_at: '2027-03-04T09:00:00+00:00', ends_at: '2027-03-04T18:00:00+00:00', timezone: 'Europe/London' });
await admin.ticketTypes.create(ev.id, { name: 'General', kind: 'paid', price_minor: 4000, capacity: 800 });
await admin.events.publish(ev.id);
const orders = await admin.orders.list(ev.id, { limit: 50 });

Resources: events (with sessions, speakers, zones, booths), ticketTypes (with promoCodes), checkout, orders, attendees, checkin, organisations (members, apiKeys, stripe), webhookEndpoints, interactions, me().

Rules baked in

  • Every write sends an Idempotency-Key (a UUID) so a retried call never creates a second event or refund. Pass { idempotencyKey } as the last argument to control it.
  • Errors throw KonectoError with status, code, message, requestId and details. Quote the request id when you talk to support.
  • A secret key in a browser throws before any request is made.
  • Money is integer minor units: 4000 is £40.00.

Verify webhooks

import { constructWebhookEvent } from '@konecto/sdk';

const event = await constructWebhookEvent(rawBody, request.headers.get('Konecto-Signature'), process.env.KONECTO_WEBHOOK_SECRET);
if (event.type === 'order.paid') { /* event.data.order_id */ }

Works in Node 20+, Cloudflare Workers, Deno and Bun (WebCrypto). verifyWebhookSignature(body, header, secret) returns a boolean if you prefer.

The SDK types are generated from the OpenAPI spec, so every method and field matches the API. Source and issues: the @konecto/sdk package README.

Plain-text version for agents: llm.konec.to/docs/sdk.md