{"_id":"blueping","_rev":"3-e5d15b0d62557e640346e3b586a482a0","name":"blueping","dist-tags":{"latest":"2.0.1"},"versions":{"0.0.0-stage":{"name":"blueping","version":"0.0.0-stage","_id":"blueping@0.0.0-stage","stub":true,"maintainers":[{"name":"blueping","email":"hello@blueping.dev"}],"dist":{"shasum":"c82ddd65921b8f4c01617c3df5fe7360e8bdb959","tarball":"https://registry.npmjs.org/blueping/-/blueping-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-/whwZdHin1Yoz86aQm/97FkjpSfMWSrLPQys+I+LbPccg9kNv2fSE2VkctBVOCBcDNx5pPNL+mpmvCtqm9GL1g==","signatures":[{"sig":"MEUCID4X4G6lm+aM3DJUSbglMJF02lf8DUvsnBG93J9qbwj9AiEAtTtTE5/yI1ou7P2xEq12rPxgYztBCI/tGSrcObS/De8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":330},"_npmUser":{"name":"blueping","email":"hello@blueping.dev"},"description":"Temporary package placeholder for staged publishing","directories":{}},"2.0.0":{"name":"blueping","version":"2.0.0","keywords":["email","email-api","inbox","ai-agents","agent-email","ai-agent-email","email-for-ai-agents","agent-inbox","email-inbox","inbound-email","email-to-json","verification-code","otp","webhooks","mcp","sdk","cli","typescript","agent-skills","blueping"],"author":{"url":"https://blueping.dev","name":"Blueping","email":"hello@blueping.dev"},"license":"MIT","_id":"blueping@2.0.0","maintainers":[{"name":"blueping","email":"hello@blueping.dev"}],"homepage":"https://blueping.dev","bugs":{"url":"https://blueping.dev/support","email":"hello@blueping.dev"},"bin":{"blueping":"dist/cli.js"},"dist":{"shasum":"d3e7c9a57082d1d753cb1d0a18b75d2ab49d8b01","tarball":"https://registry.npmjs.org/blueping/-/blueping-2.0.0.tgz","fileCount":43,"integrity":"sha512-Bs1ZtccdxQRgQUKFQfzJ8XnmgIhCNWDBX3jmSWFRc4uuSUpz97rb2wTYKRNbuPMoQjsP2pREtak+ZBFtyjXHzQ==","signatures":[{"sig":"MEYCIQCxGT3+J6SSCkAw8zFWiT08aBM4WfeR2DXzbkLA7XbeoQIhALBMFfxoKnWVqSfkEx1PYKItrbgGEmK3ZJO1DTKYQE3p","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIBN+9bQrMAr80RuRRjo4ytRm8TjBYloXdqbKoAk++5LNAiBXYkSiihdaVHzFYG3JwbhGmqb6O1qvet8/oy8e3/MZmQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":269696},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"npm run build && tsc -p test/tsconfig.json && node --test --test-reporter=spec test/*.test.mjs","build":"npm run clean && tsc -p tsconfig.json","clean":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","typecheck":"tsc -p tsconfig.json --noEmit && tsc -p test/tsconfig.json","prepublishOnly":"npm test"},"_npmUser":{"name":"blueping","email":"hello@blueping.dev"},"_npmVersion":"11.12.1","description":"Email inboxes for AI agents: the Blueping client for Node.js. One call gives an agent its own inbox; read mail as JSON, wait for verification codes (OTP), send and reply. Typed, with a CLI and no dependencies.","directories":{},"sideEffects":false,"_nodeVersion":"26.0.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^18.19.130"},"_npmOperationalInternal":{"tmp":"tmp/blueping_2.0.0_1795976636199_0.40525459074780434","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"_id":"blueping@2.0.1","bin":{"blueping":"dist/cli.js"},"bugs":{"url":"https://blueping.dev/support","email":"hello@blueping.dev"},"dist":{"shasum":"8a7aa29b42f59f22035da65bca18f4d4f85b3e2b","tarball":"https://registry.npmjs.org/blueping/-/blueping-2.0.1.tgz","fileCount":43,"integrity":"sha512-ciuXQeOvoc6+eLsmfQHlHiZunRkdzdaqeb3BjhTIuxTVbUBewIYQ+om33k143LOUrvLipLhN4lc2hFbruZI1Uw==","signatures":[{"sig":"MEUCIQCU/b4qvQ79gAY27AcT2q39v1HEl39KZ6KE0CzyWJNBsQIgaiASsCn9QwwcoIHDREdUYUXxw27dLzNjDIHKSc2LcU0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCGoNFhyUg6HtbaOxr2wHpMhV60sN/BPVQvUTGfRM4sgQIhAN1MBOPtc08CoASYkVrhh8r2VBnOcVwpiPyc+JCxVslC"}],"unpackedSize":269699},"main":"./dist/index.js","name":"blueping","type":"module","types":"./dist/index.d.ts","author":{"url":"https://blueping.dev","name":"Blueping","email":"hello@blueping.dev"},"engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"license":"MIT","scripts":{"test":"npm run build && tsc -p test/tsconfig.json && node --test --test-reporter=spec test/*.test.mjs","build":"npm run clean && tsc -p tsconfig.json","clean":"node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"","typecheck":"tsc -p tsconfig.json --noEmit && tsc -p test/tsconfig.json","prepublishOnly":"npm test"},"version":"2.0.1","_npmUser":{"name":"blueping","email":"hello@blueping.dev"},"homepage":"https://blueping.dev","keywords":["email","email-api","inbox","ai-agents","agent-email","ai-agent-email","email-for-ai-agents","agent-inbox","email-inbox","inbound-email","email-to-json","verification-code","otp","webhooks","mcp","sdk","cli","typescript","agent-skills","blueping"],"_npmVersion":"11.12.1","description":"Email inboxes for AI agents: the Blueping client for Node.js. One call gives an agent its own inbox; read mail as JSON, wait for verification codes (OTP), send and reply. Typed, with a CLI and no dependencies.","directories":{},"maintainers":[{"name":"blueping","email":"hello@blueping.dev"}],"sideEffects":false,"_nodeVersion":"26.0.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^7.0.2","@types/node":"^18.19.130"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/blueping_2.0.1_1795983429872_0.24453398407088145"}}},"time":{"created":"2026-11-29T18:22:19.253Z","modified":"2026-11-29T20:17:10.113Z","0.0.0-stage":"2026-11-29T18:22:19.253Z","2.0.0":"2026-11-29T18:23:56.308Z","2.0.1":"2026-11-29T20:17:09.970Z"},"bugs":{"url":"https://blueping.dev/support","email":"hello@blueping.dev"},"author":{"url":"https://blueping.dev","name":"Blueping","email":"hello@blueping.dev"},"license":"MIT","homepage":"https://blueping.dev","keywords":["email","email-api","inbox","ai-agents","agent-email","ai-agent-email","email-for-ai-agents","agent-inbox","email-inbox","inbound-email","email-to-json","verification-code","otp","webhooks","mcp","sdk","cli","typescript","agent-skills","blueping"],"description":"Email inboxes for AI agents: the Blueping client for Node.js. One call gives an agent its own inbox; read mail as JSON, wait for verification codes (OTP), send and reply. Typed, with a CLI and no dependencies.","maintainers":[{"name":"blueping","email":"hello@blueping.dev"}],"readme":"# Blueping for Node.js\n\nBlueping gives your AI agent its own email inbox in one API call: `username@blueping.dev`, receiving at once. Every message arrives as clean JSON, with the sender's new words, verification codes (OTP) and links pulled out, attachments readable as text, and a verdict on who sent it and what it says.\n\nThis package gives you a typed client, webhook verification and the `blueping` CLI. It has no dependencies and runs on Node.js 18+, Bun, Deno and Cloudflare Workers.\n\n- Website: [blueping.dev](https://blueping.dev)\n- Docs and API reference: [blueping.dev/docs](https://blueping.dev/docs)\n\n## Email inboxes for agents\n\nAn agent can have its own inbox, `username@blueping.dev`, in one call, with no key and no person to start: `Blueping.signup()` makes the agent, its key and its first inbox, which receives at once.\n\n```js\nimport { Blueping } from \"blueping\";\n\nconst { api_key, client, inbox } = await Blueping.signup({ name: \"Acme Support\", ownerEmail: \"you@example.com\" });\n// Keep api_key: this is the only answer that shows it.\n\n// Sign up to a service with inbox.address, then wait for its code or its sign-in link.\nconst { code, link } = await client.waitForCode(inbox.id, { from: \"service.example\" });\n```\n\nUntil a person claims the agent, it writes only to people who wrote to it first, and to `echo@blueping.dev`, which answers within seconds with a test code. The owner gets a 6-digit code by email, and `client.verifySignup(code)` claims the agent.\n\nWith a key from your dashboard, `new Blueping()` reads `BLUEPING_API_KEY`, and each agent gets as many inboxes as its plan holds:\n\n```js\nconst blueping = new Blueping();\nconst support = await blueping.inboxes.create({ username: \"acme-support\", displayName: \"Acme Support\", clientId: \"support\" });\nconsole.log(support.address); // acme-support@blueping.dev\n```\n\n```js\nconst page = await client.inboxes.listMessages(inbox.id, { wait: 30 });\nconsole.log(page.held); // what was kept back and why: includeHeld: true lists it\nawait client.messages.reply(page.data[0].id, { text: \"Thanks, received.\" });\nawait client.inboxes.send(inbox.id, { to: \"ana@example.com\", subject: \"Your invoice\", text: \"Attached.\", attachments: [{ filename: \"invoice.pdf\", contentType: \"application/pdf\", content: pdfBytes }] });\n```\n\nThe rest of the mailbox works the same way:\n\n```js\nawait client.messages.forward(page.data[0].id, { to: \"accounting@acme.com\", text: \"For the books.\" });\nawait client.messages.label(page.data[0].id, { add: [\"invoices\"] });\nconst { text } = await client.messages.attachmentText(page.data[0].id, page.data[0].attachments[0].id); // what the file says\nconst draft = await client.drafts.create(inbox.id, { to: \"ana@acme.com\", subject: \"Reminder\", text: \"Tomorrow at 9.\", sendAt: new Date(Date.now() + 3_600_000) });\nawait client.rules.add(inbox.id, { direction: \"receive\", action: \"block\", value: \"@spam.example\" });\n```\n\n`client.inboxes.listThreads()` and `client.threads` read and label conversations, `client.drafts` writes, schedules and sends drafts, and `client.rules` keeps each inbox's allow and block lists.\n\nEvery email carries `auth` (SPF, DKIM and DMARC, with a verdict) and `safety` (text aimed at a model, hidden text). A message whose sender failed authentication, or that carries instructions for a model, is held: lists count it in `held`, and `includeHeld: true` shows it. Every send, forward and new draft carries an Idempotency-Key, so a retry sends or writes once. `client.me.limits()` says what the agent may send now, with `warnings` from 80% of a limit.\n\n### A send that meets a limit waits\n\nA send past a limit that only takes time, such as the plan's day or month or the ramp of new recipients, is never refused for it: it comes back with `status: \"queued\"`, `sends_at` and `reason`, and goes out by itself at `sends_at`, with every check run again. Every send's answer reads its `Blueping-Usage` header for you, in `usage`.\n\n```js\nconst sent = await client.inboxes.send(inbox.id, { to: \"ana@example.com\", subject: \"Your invoice\", text: \"Attached.\" });\nif (sent.status === \"queued\") console.log(`goes at ${sent.sends_at}, waiting for ${sent.reason}`);\nconsole.log(sent.usage); // { day: { used: 42, allowed: 100 }, month: { used: 1200, allowed: 3000 } }\n\n// Refused instead of queued, for code that decides itself: throws daily_limit_reached and the others.\nawait client.inboxes.send(inbox.id, { to: \"ana@example.com\", subject: \"Now or never\", text: \"Hi\", ifLimited: \"refuse\" });\n```\n\n### Email plans\n\n| Plan | Price | Inboxes | Emails sent a month | A day |\n| --- | --- | --- | --- | --- |\n| Free | $0 | 3 | 3,000 | 100 |\n| Developer | $19 a month, or $180 a year | 50 | 15,000 | 1,500 |\n| Startup | $79 a month, or $780 a year | 500 | 75,000 | 7,500 |\n| Scale | $249 a month, or $2,484 a year | 5,000 | 300,000 | 30,000 |\n\nMail the agent receives never counts as a send: the plan's storage is what holds it. On Free, mail the agent sends ends with a short \"Sent with Blueping\" line; paid plans add nothing. `client.me.mailPlanCheckout({ plan: \"developer\", period: \"year\" })` answers a payment page for the agent's owner to open in their own browser. Every limit: [blueping.dev/pricing](https://blueping.dev/pricing).\n\n### Many inboxes, delivery and events\n\n```js\n// One inbox per customer, up to 50 in one call: the same clientId twice makes nothing twice.\nconst batch = await blueping.inboxes.createMany([{ username: \"acme-1\", clientId: \"cust_1\" }, { username: \"globex\", clientId: \"cust_2\" }]);\nfor await (const inbox of blueping.inboxes.iterate()) console.log(inbox.address); // page after page\n\n// Whether mail reached people, and the addresses nothing more goes to.\nconst health = await blueping.inboxes.deliverability(support.id, { days: 30 });\nconst { suppressed } = await blueping.suppressions.get(\"bob@example.net\").catch(() => ({ suppressed: false }));\n\n// Every event as it happens, kept 7 days: new mail, deliveries, bounces and complaints.\nfor await (const event of blueping.events.iterate({ types: [\"email.received\", \"email.bounced\"] })) console.log(event.type, event.data);\n\n// Search every inbox: the text, and on a paid plan the files' text.\nconst found = await blueping.search({ q: \"invoice november\", hasAttachment: true });\nconst month = await blueping.usage.get({ month: \"2026-11\" });\n```\n\nA key can be limited to one inbox and to permissions: a call past them throws `PermissionDenied` (with `required`) or `InboxOutOfScope` (with `keyInboxId`), both a `BluepingError`. `blueping.messages.release(id)` lets a held message in, with a key that holds `held:release`. With an admin key, `new BluepingOrg()` reads `BLUEPING_ADMIN_KEY` and creates agents and their keys: `org.agents.create()`, `org.keys.create()`, `org.audit.list()` and `org.usage()`. [Keys and permissions](https://blueping.dev/docs/keys).\n\n## Get a key in 30 seconds\n\nAn agent signs itself up from a terminal, with no key and no person. The key is saved in `~/.config/blueping/config.json`, readable only by you, and never printed:\n\n```bash\nnpx blueping signup --username acme-signups --owner you@example.com\n```\n\nA person gets a key for an account of their own by approving the terminal in their browser:\n\n```bash\nnpx blueping login\n```\n\nThe CLI shows a short code and opens a page in your browser. Sign in with Google, GitHub or your email, check that the page shows the same code and approve, with no credit card. You can also sign up at [blueping.dev/signup](https://blueping.dev/signup) and copy the key from the dashboard, then save it with `printf %s \"$KEY\" | npx blueping login --with-key`.\n\nAn agent working for a person uses two steps instead, so it can show the link while it waits: `npx blueping login --start`, then `npx blueping login --check` until it prints `approved`. Without a terminal, or with `--json`, a plain `login` starts and returns the same way.\n\n## Try it in a minute\n\n```bash\nnpm install blueping\n```\n\n```js\nimport { Blueping } from \"blueping\";\n\nconst blueping = new Blueping(); // reads BLUEPING_API_KEY\n\nconst inbox = await blueping.inboxes.create({ clientId: \"first-try\" });\nawait blueping.inboxes.send(inbox.id, { to: \"echo@blueping.dev\", subject: \"Hello\", text: \"Testing my inbox\" });\n\n// echo@blueping.dev answers within seconds, with a test code.\nconst { code } = await blueping.waitForCode(inbox.id, { from: \"blueping.dev\" });\nconst { data } = await blueping.inboxes.listMessages(inbox.id);\nconsole.log(inbox.address, code, data.map((message) => message.subject));\n```\n\n`clientId` makes the create safe to run again: the same id returns the same inbox.\n\n## Options\n\n```js\nconst blueping = new Blueping({\n  apiKey: \"bp_live_...\",\n  baseUrl: \"https://blueping.dev\",\n  maxRetries: 2,\n  timeoutMs: 30_000,\n});\n```\n\n| Option | Default | What it does |\n| --- | --- | --- |\n| `apiKey` | `BLUEPING_API_KEY`, then the key saved by `npx blueping login` on Node.js 20.16 and 22.3 or later | Your API key |\n| `baseUrl` | `BLUEPING_BASE_URL`, then the saved key's server, then `https://blueping.dev` | The API address |\n| `maxRetries` | `2` | Retries after a network error or a 500, with the same Idempotency-Key |\n| `timeoutMs` | `30000` | How long each attempt may take |\n| `fetch` | the global `fetch` | Your own fetch implementation |\n\n## Retries and idempotency\n\nEvery send, reply, forward and new draft carries an `Idempotency-Key`. The client makes one up and reuses it for its own retries, so a retried send never goes out twice. Blueping keeps a key 24 hours, and without one, the same message to the same people from the same inbox within 5 minutes still goes once.\n\nPass your own key when your code may run twice for the same event, such as a job that gets retried:\n\n```js\nawait blueping.messages.reply(messageId, {\n  text: \"Invoice 1042 is scheduled for payment on December 1.\",\n  idempotencyKey: `invoice-1042-ack`,\n});\n```\n\n## Handle errors\n\nEvery failed call throws a `BluepingError` with `status`, `code`, `message`, `docs_url` and `details`, which holds every extra field the API sent, `next_action` and `retry_after` included.\n\n```js\nimport { Blueping, BluepingError } from \"blueping\";\n\nconst blueping = new Blueping();\n\ntry {\n  await blueping.inboxes.send(inboxId, { to: \"ana@example.com\", subject: \"Your invoice\", text: \"Attached.\" });\n} catch (error) {\n  if (!(error instanceof BluepingError)) throw error;\n  console.log(error.code, error.details.next_action); // what to do now, written for an agent\n}\n```\n\n| Code | Status | Meaning |\n| --- | --- | --- |\n| `recipient_not_allowed` | 403 | Before a person claims the agent, it writes only to people who wrote to it first, to echo@blueping.dev and to its owner. |\n| `message_held` | 403 | A held message isn't answered or forwarded: it waits for a person. |\n| `recipient_blocked` | 403 | One of the inbox's own send rules refuses a recipient. |\n| `inbox_limit_reached` | 429 | The plan's inboxes are all in use. |\n| `queue_full` | 429 | The send met a limit and the queue is full. `retry_after` says when it has room. |\n| `no_code_yet` | 404 | `waitForCode` found no code in time. Call it again. |\n| `too_many_recipients` | 400 | 10 addresses at most per message, to, cc and bcc together. |\n| `attachments_too_large` | 413 | 10 MB of attachments per send. |\n| `rate_limited` | 429 | Too many requests in a short time. Wait `retry_after` seconds. |\n| `unauthorized` | 401 | The API key is wrong, or was revoked. |\n| `internal_error` | 500 | Something failed on Blueping's side. The client already retried with the same key. |\n| `network_error` | 0 | No answer from the API, even after the retries. |\n| `missing_api_key` | 0 | No key was passed, `BLUEPING_API_KEY` is not set and no key is saved. |\n\nA limit the agent's owner can lift, such as `inbox_limit_reached` or `daily_limit_reached` on Free, also carries `upgrade_url` and `owner_message`: one line, with the page where the owner decides, for the agent to pass on as it is.\n\nEvery code, with what it means and what to do: [blueping.dev/docs/errors](https://blueping.dev/docs/errors).\n\n## Receive email with a webhook\n\nBlueping posts each event to your webhook URL as JSON: `email.received` when mail reaches an inbox, `email.held` when it is kept back, `email.sent` when a send goes out, `email.delivered`, `email.deferred`, `email.bounced` and `email.complained` for each recipient, `email.suppressed` when an address joins the suppression list, `email.failed` when a send fails, and `email.draft_failed` when a scheduled draft fails. `isDeliveryEvent(event)` picks the delivery events. `isEmailEvent(event)` tells the message events apart, and each carries `data.inbox` and `data.message`.\n\n```js\nconst hook = await blueping.webhooks.create({ url: \"https://example.com/blueping\", events: [\"email.received\", \"email.bounced\"] });\nconsole.log(hook.secret); // whsec_..., store it as BLUEPING_WEBHOOK_SECRET\n```\n\n`email.held` needs a key that holds `held:read`.\n\n`verifyWebhook` checks the `Blueping-Signature` header with Web Crypto, compares signatures in constant time, rejects events older than 5 minutes and returns the event, typed by its `type`. It throws a `WebhookVerificationError` otherwise. It needs the raw body exactly as it arrived, so read it before any JSON parsing.\n\nAnswer with a 2xx within 10 seconds. Failed deliveries are retried for about 31 hours, so the same event can arrive twice: dedupe on `event.id`.\n\n### Express\n\n```js\nimport express from \"express\";\nimport { Blueping, isEmailEvent, verifyWebhook } from \"blueping\";\n\nconst app = express();\nconst blueping = new Blueping();\n\napp.post(\"/blueping\", express.raw({ type: \"application/json\" }), async (req, res) => {\n  let event;\n  try {\n    event = await verifyWebhook({\n      rawBody: req.body, // a Buffer, thanks to express.raw()\n      signature: req.get(\"Blueping-Signature\"),\n      secret: process.env.BLUEPING_WEBHOOK_SECRET,\n    });\n  } catch {\n    return res.sendStatus(400);\n  }\n\n  res.sendStatus(200);\n\n  if (event.type === \"email.received\" && isEmailEvent(event)) {\n    const { id, subject } = event.data.message;\n    blueping.messages.reply(id, { text: `Received: ${subject}`, idempotencyKey: event.id }).catch(console.error);\n  }\n});\n\napp.listen(3000);\n```\n\n### Hono on Cloudflare Workers\n\n```ts\nimport { Hono } from \"hono\";\nimport { Blueping, isEmailEvent, verifyWebhook, type WebhookEvent } from \"blueping\";\n\ntype Bindings = { BLUEPING_API_KEY: string; BLUEPING_WEBHOOK_SECRET: string };\n\nconst app = new Hono<{ Bindings: Bindings }>();\n\napp.post(\"/blueping\", async (c) => {\n  let event: WebhookEvent;\n  try {\n    event = await verifyWebhook({\n      rawBody: await c.req.text(),\n      signature: c.req.header(\"Blueping-Signature\"),\n      secret: c.env.BLUEPING_WEBHOOK_SECRET,\n    });\n  } catch {\n    return c.text(\"Invalid signature\", 400);\n  }\n\n  if (event.type === \"email.received\" && isEmailEvent(event)) {\n    const blueping = new Blueping({ apiKey: c.env.BLUEPING_API_KEY });\n    const { id, subject } = event.data.message;\n    c.executionCtx.waitUntil(blueping.messages.reply(id, { text: `Received: ${subject}`, idempotencyKey: event.id }));\n  }\n  return c.body(null, 204);\n});\n\nexport default app;\n```\n\nWith Hono on Node.js there is no `executionCtx`: call `blueping.messages.reply(...)` directly.\n\n## Runtimes\n\n- **Node.js 18 and later**: works as is.\n- **Bun and Deno**: the same code. Deno reads `BLUEPING_API_KEY` when the script may read the environment (`--allow-env`).\n- **Cloudflare Workers**: there is no `process.env`, so pass the key from your bindings: `new Blueping({ apiKey: env.BLUEPING_API_KEY })`.\n- **Browsers**: don't. The API key would be visible to anyone. Call Blueping from your server.\n\n## CLI\n\nThe `blueping` command works an inbox from a terminal or an agent's shell. Every command takes `--json`, and none prints a key.\n\n```bash\nnpx blueping signup                                   # an agent signs itself up and saves its key\nnpx blueping inbox create acme-support                # acme-support@blueping.dev, receiving at once\nnpx blueping code --from github.com                   # waits for a verification code and prints it alone\nnpx blueping mail --follow                            # the newest mail, then new mail as it arrives\nnpx blueping read em_9PzR4fYc1KwM6tDq3VxB             # one email whole, with its verdicts\nnpx blueping send ana@example.com --subject \"Your invoice\" --text \"Attached.\"\necho \"Thanks, received.\" | npx blueping reply em_9PzR4fYc1KwM6tDq3VxB\nnpx blueping limits                                   # the plan, the claim, what is left today\nnpx blueping upgrade --plan developer                 # a payment page for the agent's owner\nnpx blueping help                                     # every command and option\n```\n\n- `code` exits with 2 when no code arrived in time, so a script can wait again.\n- `claim <owner_email>` emails the owner a 6-digit code, and `verify <code>` claims the agent with it.\n- `webhooks`, `webhooks add <url>`, `webhooks test <id>` and `webhooks remove <id>` manage webhooks. A new webhook's signing secret prints at a terminal, or goes to a private file with `--secret-file`.\n- `upgrade` prints a Stripe page for the owner to open in their own browser: nothing is bought until they pay.\n- `mcp` serves Blueping's hosted MCP server over stdio, for MCP clients that only start local servers: the command is `npx -y blueping mcp`, with `BLUEPING_API_KEY` set or a saved key.\n\nThe CLI uses `BLUEPING_API_KEY` when it is set, and the saved key otherwise. `BLUEPING_BASE_URL` points it at another server, such as `http://localhost:8787` for local development.\n\n### In CI\n\nA job can test your app's emails end to end: give the sign-up form a fresh inbox, wait for the email, and check its link. `clientId` keeps one inbox per branch, so a job that runs again reuses it:\n\n```js\nconst inbox = await blueping.inboxes.create({ clientId: `ci-${process.env.GITHUB_REF_NAME}` });\nawait signUp(inbox.address); // your app's own sign-up, pointed at this address\nconst { link } = await blueping.waitForCode(inbox.id, { from: \"app.example\" });\nassert.ok(link, \"the confirmation email arrived with its link\");\n```\n\n## Use Blueping from Claude Code and other agents\n\nAn agent can make and read its own inbox. Paste this into it:\n\n```text\nRead https://blueping.dev/agent-onboarding.md and set yourself up with a Blueping inbox.\n```\n\nOr add the hosted MCP server. There is nothing to install, and it signs in through the browser:\n\n```bash\nclaude mcp add --transport http blueping https://blueping.dev/mcp\nclaude mcp login blueping\n```\n\nFor a client that only starts local servers, `npx -y blueping mcp` carries the same tools over stdio, with your key.\n\nThis package also ships two Agent Skills: `skills/blueping/SKILL.md`, the same skill as [blueping.dev/.well-known/agent-skills/blueping/SKILL.md](https://blueping.dev/.well-known/agent-skills/blueping/SKILL.md), and `skills/blueping-cli/SKILL.md`, for agents that work through this CLI. Copy either folder into your agent's skills folder.\n\nCursor, Codex, ChatGPT, a key instead of OAuth, the skill and the plugin: [blueping.dev/agents](https://blueping.dev/agents). Every framework and client, set up in a few lines: [blueping.dev/integrations](https://blueping.dev/integrations).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}