TypeScript SDK
@peer10/sdk is a typed client over the same manifest the API is built from: fifteen mounted resources plus hand-written simulation-first overrides, and a typed request escape hatch that reaches every public endpoint. It is not yet on npm; inside the monorepo it is "@peer10/sdk": "workspace:*".
Client
import { Peer10Client } from '@peer10/sdk';
const client = new Peer10Client({
baseUrl: 'https://peer10.com',
apiKey: 'p10_live_...', // or token: 'eyJ...'
});
const seasons = await client.seasons.list();
const team = await client.teams.create({ divisionId, name: 'Blue Jays', color: 'blue' });The escape hatch
The API is larger than the mounted resources. Anything in the reference is reachable through client.request — this is exactly what the CLI and MCP server use internally:
const feed = await client.request('GET', '/api/v1/activity/feed');
const key = await client.request('POST', '/api/v1/api-keys', {
body: { name: 'my-script' },
});Pagination, streaming, errors
import { paginate, streamSSE, NotFoundError, AuthenticationError } from '@peer10/sdk';
// listAll iterates every page of a list resource
for await (const page of paginate((p) => client.players.list(p))) { /* … */ }
try {
await client.seasons.get('nonexistent');
} catch (err) {
if (err instanceof NotFoundError) { /* 404 */ }
}