These recipes use the official client, bounded pagination and explicit error handling. Their request shapes are exercised by the SDK test suite.
import { CeyuApiError, CeyuClient } from "@ceyu/api";
const ceyu = new CeyuClient({ apiKey: process.env.CEYU_API_KEY! });
try {
await ceyu.createTask({
workspace: process.env.CEYU_WORKSPACE_ID!,
project: process.env.CEYU_PROJECT_ID!,
title: submission.subject,
description: submission.message,
}, { idempotencyKey: `form:${submission.id}` });
} catch (error) {
if (error instanceof CeyuApiError) console.error(error.code, error.requestId);
throw error;
}
Persist next_cursor after each successful page and pass it back as starting_after. Select only the fields needed by the accounting transform.
Subscribe only to task update events, verify the raw body, acknowledge immediately, then post to Slack from a queue. Store the Ceyu event ID before sending to make retries harmless.
Create the endpoint with exclude_own_events, map both systems’ IDs in durable storage, use the external change ID as Idempotency-Key, and reject stale updates with If-Match.