{
  "markdown": "# tinysend\n\nOfficial TypeScript SDK for the [tinysend](https://tinysend.com) API. Zero dependencies, fetch-based — works in Node.js, Bun, Deno, Cloudflare Workers, and browsers.\n\n[![subscribers](https://updates.tinysend.com/subscribers.svg)](https://updates.tinysend.com)\n\n- website: [tinysend.com](https://tinysend.com)\n- docs: [tinysend.com/docs](https://tinysend.com/docs)\n- agents: [tinysend.com/agents](https://tinysend.com/agents)\n\n## Install\n\n```bash\nnpm install tinysend\n```\n\n## Getting a token\n\nEvery call needs a bearer token (`sk_...`).\n\n- humans: create one in your account settings at [tinysend.com](https://tinysend.com)\n- agents: register yourself — no human in the loop. The protocol is at [tinysend.com/auth.md](https://tinysend.com/auth.md) (POST to id.tinysend.com/agent/auth), walkthrough at [tinysend.com/agents/agent-auth](https://tinysend.com/agents/agent-auth)\n\n## Usage\n\n```typescript\nimport { Tinysend } from 'tinysend';\n\nconst ts = new Tinysend('sk_...');\n\n// lists\nconst lists = await ts.lists.list();\nconst list = await ts.lists.create({ name: 'Weekly Update' });\n\n// subscribers\nawait ts.subscribers.create(list.id, { email: 'user@example.com', verified: true });\n\n// send an email\nconst post = await ts.posts.create(list.id, {\n  subject: 'Hello World',\n  body_html: '<p>Welcome to our newsletter!</p>',\n});\nawait ts.posts.send(list.id, post.id);\n\n// contacts\nconst contacts = await ts.contacts.list({ search: 'john' });\n\n// mailboxes\nconst mailboxes = await ts.mailboxes.list();\n\n// stats\nconst stats = await ts.stats.project();\n\n// webhooks\nconst hook = await ts.webhooks.create({\n  url: 'https://example.com/webhook',\n  events: ['post.sent', 'subscriber.created'],\n});\n\n// sender domain (who emails come from)\nawait ts.sender.set(list.id, { type: 'custom_domain', name: 'James', email: 'james', domain: 'acme.com' });\nawait ts.sender.check(list.id); // re-check DNS\n\n// custom domain for the archive site\nawait ts.siteDomains.set(list.id, { domain: 'news.acme.com' });\n\n// waitlists\nawait ts.lists.join(list.id, { email: 'user@example.com' });\nawait ts.lists.invite(list.id, { count: 100 });\n\n// automations, invites, usage, settings\nconst automations = await ts.automations.list();\nconst invites = await ts.invites.list();\nconst usage = await ts.usage.get();\n```\n\nThe SDK covers the full API surface — verified against the live [openapi spec](https://api.tinysend.com/v1/openapi.json) on every release.\n\n## Error handling\n\n```typescript\nimport { Tinysend, TinysendError } from 'tinysend';\n\ntry {\n  await ts.lists.get('nonexistent');\n} catch (err) {\n  if (err instanceof TinysendError) {\n    console.log(err.status);  // 404\n    console.log(err.code);    // 'not_found'\n    console.log(err.message); // 'list not found'\n  }\n}\n```\n\n## Configuration\n\n```typescript\nconst ts = new Tinysend('sk_...', {\n  baseUrl: 'https://api.tinysend.com/v1',  // default\n  fetch: customFetch,                        // custom fetch implementation\n});\n```\n\n## License\n\nMIT\n\n---\n\na [system operator](https://systemoperator.com) product\n",
  "bytes": 3049,
  "sha": "bd83b79d02694a6e464c432318c8f1a945fa437e0794eab2e6a4c47fa44bc4ce",
  "repo_slug": "tiny-send/tinysend-node",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_com_tinysend_tinysend_62b5fe9b/readme"
}