The SDK
@sypnia/app: the App API from TypeScript, with streaming sessions.
On this page
npm install @sypnia/appimport { createApp } from '@sypnia/app';
const app = createApp({ token: process.env.SYPNIA_APP_TOKEN });
const board = await app.projects.board('laespiga');
console.log(board.health.state); // 'healthy'
console.log(board.domain.renewsOn); // '2027-11-18'A session, streamed
const session = await app.sessions.create({ project: 'laespiga', title: 'Morning check' });
for await (const event of app.sessions.send(session.id, 'How is it going?')) {
if (event.type === 'text') process.stdout.write(event.text);
if (event.type === 'question') console.log('\n', event.question, event.options);
}Events: text, question, approval, panel (what the side panel would open), task (a task started, progressed or ended) and done. An approval can be read, but only a person can answer it, in App.
Credits
const { balance, held } = await app.credits.balance();
const rows = await app.credits.ledger({ project: 'laespiga', group: 'case', from: '2026-11-01' });
const { approvalUrl } = await app.credits.topUp({ amount: 20 }); // USD, at least 5; a person opens it and pays with PayPalErrors
Every error is an AppError with code, status and message, the same codes as the API.
In the browser
In a browser, the SDK uses the person’s Sypnia session and never needs a token. Never put a token in code that reaches a browser.