SDK quickstart
Install
Section titled “Install”npm install @teamgrid/api-client@nextCreate a client
Section titled “Create a client”import { TeamGridClient } from '@teamgrid/api-client'
const client = new TeamGridClient({ token: process.env.TEAMGRID_API_TOKEN!,})The client derives the regional API endpoint from the credential. Do not hard-code the German endpoint in a multi-region service.
Read a page
Section titled “Read a page”const page = await client.tasks.list({ limit: 50, projectId: 'project-id',})
for (const task of page.data) { console.log(task.id, task.attributes.name)}Create safely
Section titled “Create safely”const result = await client.tasks.create( { name: 'Prepare launch', projectId: 'project-id', }, { idempotencyKey: 'launch-task-1' },)
console.log(result.data.id)Keep the credential in a secret manager and inject it through the process environment. Never bundle it into browser code.