SDK reference
Official, typed clients for TypeScript, Python and Go. They wrap the REST API, share one resource model, and read your key and region from the environment.
Every SDK exposes the same resources with idiomatic naming, so a pattern you learn in one language carries to the others. They handle auth, regional routing, pagination and retries on 429, leaving you to call methods that mirror the API reference.
All three read ORTHID_SECRET_KEY and ORTHID_REGION from the environment, so initialisation is usually a single line.
TypeScript
The @orthid/sdk package is the server client. For React and Next.js front ends use @orthid/react and @orthid/nextjs instead - see the Node quickstart.
npm install @orthid/sdk
import { orthid } from "@orthid/sdk";
// Configured from ORTHID_SECRET_KEY and ORTHID_REGION.
const user = await orthid.users.get("user_5f3a");
const session = await orthid.sessions.verify(token);
console.log(session.actor.id);Python
The orthid package exposes a synchronous client and an AsyncOrthID for asyncio code. Methods use snake_case to match Python conventions.
pip install orthid
from orthid import OrthID
# Reads ORTHID_SECRET_KEY and ORTHID_REGION from the environment.
client = OrthID()
user = client.users.get("user_5f3a")
session = client.sessions.verify(token)
print(session.actor.id)Go
The orthid-go module returns explicit errors in the Go style and takes a context.Context on every call so you can carry deadlines and cancellation.
go get github.com/orthid/orthid-go
package main
import (
"context"
"fmt"
"github.com/orthid/orthid-go"
)
func main() {
// Reads ORTHID_SECRET_KEY and ORTHID_REGION from the environment.
client := orthid.New()
user, err := client.Users.Get(context.Background(), "user_5f3a")
if err != nil {
panic(err)
}
fmt.Println(user.ID)
}secretKey and region, which is useful when one process serves more than one region.Resource surface
The same five resources are present in every SDK. Names differ only by language casing (organizations in TypeScript and Python, Organizations in Go).
| Resource | Methods |
|---|---|
users | get, list, create, update, delete |
organizations | create, get, list, addMember, removeMember |
sessions | verify, revoke, list |
agents | issue, revoke, list |
audit | list, export |
Issuing an agent credential looks the same shape in any SDK - a person to act for, a tight scope, a short TTL and a region:
const agent = await orthid.agents.issue({
onBehalfOf: "user_5f3a",
scope: ["records:read"],
ttl: "10m",
region: "au-syd-1",
});next_cursor yourself.Next steps
- API reference - the endpoints these SDKs wrap, plus errors and rate limits.
- Node quickstart - wire the SDK into a backend end to end.
- Scope an agent - use
agents.issuein a real flow.