Skip to content

The SDK

@lobo-one/sdk is a TypeScript client generated from the API’s own OpenAPI document and wrapped with the parts a generator cannot know: authentication, the organizational context, pagination, typed errors, retries and webhook verification. It runs wherever fetch does — Node, and React Native.

Generated, not written

The document the API serves at /v1/openapi.json is exported into the package and rendered into types by openapi-typescript. The paths, the parameters and the responses you see in your editor are the API’s own; a route that changes shape changes the client in the same commit. Nothing about a resource is copied by hand.

A representative call

typescriptthe client, a call and an error
import { createLoboOneClient, paginate, LoboOneApiError } from '@lobo-one/sdk';

const lobo = createLoboOneClient({
  baseUrl: 'https://api.one.dev.ellobolabs.tech',
  accessToken: () => tokens.current(),   // your client-credentials token; asked on every call
  contextId: tenantId,                    // the club that granted your application
});

try {
  const page = await lobo.call('GET', '/v1/tenants/{tenantId}/members', {
    params: { path: { tenantId }, query: { limit: 50 } },
  });

  for await (const member of paginate((cursor) =>
    lobo.call('GET', '/v1/tenants/{tenantId}/members', {
      params: { path: { tenantId }, query: { cursor } },
    }),
  )) {
    // every member, page by page, until the API says there are no more
  }
} catch (error) {
  if (error instanceof LoboOneApiError) {
    error.code;              // 'platform.validation_failed', 'security.forbidden', …
    error.errors;            // which fields, and why, on a validation failure
    error.requestId;         // what to quote to support
    error.isRateLimited;     // a 429; wait error.retryAfterSeconds
  }
}

What it does for you, and what it deliberately does not

  • Retries idempotent requests — GET, PUT, DELETE — on 429 and 503, honouring Retry-After. Never a POST: one that timed out may have succeeded.
  • Verifies webhooks, from @lobo-one/sdk/webhooks: the signature in constant time, the timestamp against a tolerance, and every secret in force during a rotation. Node only, because it uses the platform’s HMAC.
  • Obtains no token. How you keep your client secret is your decision. Hand the client a function that returns a current token, and it will ask on every call.

Other languages

TypeScript and React Native are first because the platform’s own applications use the same contracts. The generation pipeline is one command over one document, and a client in another language is the same document through another generator — say which, and we will add it.

Note

The package is built from this repository and is not published to a public registry. A partner integrating today receives it from El Lobo Labs; publishing is a decision about support commitments that has not been made.