@slog-ai/sdk
v1.0.0
Published
Official TypeScript SDK for the Slog headless project management API.
Maintainers
Readme
Typescript SDK for slog
import { SlogSdk, op } from "@slog-ai/sdk"
const slog = SlogSdk({ apiKey: "...", baseUrl: "..." }); // baseUrl optional
// Auth endpoint
const me = await slog.me();
// CRUD operations
await slog.tasks.create({ title: "New task", priority: "HIGH", teamId: "..." });
await slog.tasks.update("PLAT-123", { title: "New feature", priority: "HIGH" });
await slog.tasks.delete(task.id);
// Fluent query builder with lazy execution (await triggers fetch)
const teamTasks = await slog.tasks
.where({ status: "TODO" })
.where({ teamId: "123" })
.where({ title: op.contains('foo') })
.select({ id: true, title: true, assignee: { name: true } })
.order({ priority: 'desc' })
// Array form for simple selects
const allTasks = await slog.tasks.select('id', 'title')
.where({ createdAt: op.gt('2025-05-23') })
.where({ labels: op.oneOf(['red', 'green']) }) // maps to 'in' operator
.where({ assignee: op.present() }) // assignee is not null filter
// Get single record
const task = await slog.task('PLAT-123') // convenience singular form
const project = await slog.project('proj_01...')
const workspace = await slog.workspace('ws_01...')
// Pagination - returns array but has pagination metadata
const page1 = await slog.tasks.limit(20).select('id', 'title')
// page1.pagination.nextCursor
const page2 = await slog.tasks.limit(20).cursor(page1.pagination.nextCursor!)
// Export a resource
const exported = await slog.tasks.export('task_01...')
// Other resources
slog.teams.where(...)
slog.projects.where(...)
slog.milestones.where(...)
slog.workspaces.where(...)
// Teams — member management
const members = await slog.teams.members('team_01...')
await slog.teams.addMember('team_01...', { userId: 'user_01...', role: 'MEMBER' })
await slog.teams.removeMember('team_01...', 'user_01...')
// Invites
await slog.invites.create({ email: '[email protected]', role: 'MEMBER' })
await slog.invites.list()
await slog.invites.delete('invite_01...')Publishing to npm
The package is published as @slog-ai/sdk.
npm run build
npm login
npm publish --dry-run
npm publish --access public