Documentation

TypeScript and Swift SDKs

The official SDKs consume only the frozen public API. They do not import server internals, connect to Weirgate's database, or persist end-user provider keys.

TypeScript

Install @weirgate/sdk, then provide the app ID and an async source of fresh end-user JWTs:

import { Weirgate } from "@weirgate/sdk";

const client = new Weirgate({
  appId: "my-app",
  token: async () => getFreshEndUserJWT(),
});

const catalog = await client.features();

Mutations receive an automatic idempotency key. Failures are WeirgateError values keyed by error.type; results and errors carry request and API-version correlation.

Swift

Add https://github.com/weirgate/weirgate-sdk.git in Swift Package Manager and select the WeirgateKit product:

import WeirgateKit

let client = WeirgateClient(
    configuration: .init(appID: "my-app"),
    tokenProvider: .init { try await auth.freshIDToken() }
)

let catalog = try await client.features()

UserProviderKey is accepted per call, uses an ephemeral URL session with no URL cache, and is redacted from descriptions. Stream iterators verify final usage and termination.

Weirgate API 2026-07-18