TypeScript SDK
The@slog-ai/sdk package provides a typed client for the Slog API with a fluent query builder.
Installation
Setup
apiKey is required. baseUrl defaults to the Slog cloud endpoint.
Authentication
Current user
CRUD Operations
create: title, teamId.
For update, all fields are optional — only the provided fields are changed.
Querying
Queries are lazy: they execute only when awaited.Filtering
Chain multiple.where() calls; all conditions are combined with AND.
Field selection
Pass an object or a list of field name strings.Sorting
Pagination
nextCursor to fetch the next page:
nextCursor is null when there are no more pages.
Filter Operators
| Operator | Description | Example |
|---|---|---|
op.contains(v) | Case-insensitive substring | where({ title: op.contains("auth") }) |
op.startsWith(v) | Case-insensitive prefix | where({ title: op.startsWith("Q2") }) |
op.gt(v) | Greater than | where({ createdAt: op.gt("2025-05-23") }) |
op.gte(v) | Greater than or equal | where({ createdAt: op.gte("2025-05-23") }) |
op.lt(v) | Less than | where({ dueDate: op.lt("2026-01-01") }) |
op.lte(v) | Less than or equal | where({ dueDate: op.lte("2026-01-01") }) |
op.oneOf(arr) | Match any value in list | where({ labels: op.oneOf(["red", "green"]) }) |
op.present() | Field is not null | where({ assignee: op.present() }) |
Get a Single Record
Use the convenience singular methods — they accept either a UUID or a short reference.Agents
Create an AI agent user. The response includes the agent’s profile and a ready-to-use API key (shown only once).MEMBER role.
API Keys
List, create, and delete API keys for the current user and their owned agents.Fields
Manage workspace-scoped custom field definitions. Built-in fields are included automatically in list responses withisBuiltIn: true.