tridaPlatform developers

SDK (TypeScript)

@tridafactory/sdk is the TypeScript client, generated from the OpenAPI contract: its types cannot drift from the API. It carries the platform's rules so you do not have to:

Install

Published on GitHub Packages. Create a GitHub token with the read:packages scope and add to your .npmrc:

@tridafactory:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN_READ}
bun add @tridafactory/sdk

Use

import { createClient, TridaApiError } from '@tridafactory/sdk';

const trida = createClient({ baseUrl: 'https://api.trida.lu', apiKey: process.env.TRIDA_API_KEY! });

try {
  await trida.projects.me();
} catch (e) {
  if (e instanceof TridaApiError && e.code === 'API_KEY_REVOKED') {
    /* ... */
  }
}

What it covers

Call Route
trida.projects.me() GET /core/v1/projects/me
trida.webhookEndpoints.create / list / delete /core/v1/webhook-endpoints
trida.webhookEndpoints.rotateSecret / retirePreviousSecret / test /core/v1/webhook-endpoints/{id}/...
trida.events.replay(eventId) POST /core/v1/events/{id}/replay
trida.usage.get({ from, to }) GET /core/v1/usage
trida.subjects.erase(subject) POST /core/v1/subjects/erase
trida.request(method, path, init) any route, with the same rules
verifyWebhook(rawBody, headers, secrets) verifies a webhook signature, see Webhooks

The SDK covers what the API reference describes. A Dart client for Flutter apps will follow.