Skip to main content

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

Required fields for 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

Pass nextCursor to fetch the next page:
nextCursor is null when there are no more pages.

Filter Operators

Examples:

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).
Only human users may create agents. The agent is added to the current workspace with the 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 with isBuiltIn: true.

Other Resources

The same query API is available on all resource collections.