{"id":51646479,"url":"https://github.com/zerodrop-dev/zerodrop-sdk","last_synced_at":"2026-07-13T23:02:41.141Z","repository":{"id":361929416,"uuid":"1255450280","full_name":"zerodrop-dev/zerodrop-sdk","owner":"zerodrop-dev","description":"TypeScript SDK for email verification in CI — auto-extracts OTPs and magic links. No Docker, no regex, no signup.","archived":false,"fork":false,"pushed_at":"2026-06-23T20:37:52.000Z","size":4988,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-23T21:12:04.197Z","etag":null,"topics":["authentication","ci-cd","cloudflare-workers","cypress","developer-tools","email-testing","email-verification","github-actions","magic-link","otp-verification","playwright","redis","testing","testing-tools","typescript","upstash","upstash-redis"],"latest_commit_sha":null,"homepage":"https://zerodrop.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zerodrop-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-31T20:58:29.000Z","updated_at":"2026-06-23T20:37:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zerodrop-dev/zerodrop-sdk","commit_stats":null,"previous_names":["zerodrop-dev/zerodrop-sdk"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zerodrop-dev/zerodrop-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodrop-dev%2Fzerodrop-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodrop-dev%2Fzerodrop-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodrop-dev%2Fzerodrop-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodrop-dev%2Fzerodrop-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zerodrop-dev","download_url":"https://codeload.github.com/zerodrop-dev/zerodrop-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zerodrop-dev%2Fzerodrop-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35439213,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-13T02:00:06.543Z","response_time":119,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","ci-cd","cloudflare-workers","cypress","developer-tools","email-testing","email-verification","github-actions","magic-link","otp-verification","playwright","redis","testing","testing-tools","typescript","upstash","upstash-redis"],"created_at":"2026-07-13T23:02:40.529Z","updated_at":"2026-07-13T23:02:41.132Z","avatar_url":"https://github.com/zerodrop-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zerodrop-client\n\n[![npm version](https://img.shields.io/npm/v/zerodrop-client.svg)](https://www.npmjs.com/package/zerodrop-client)\n[![npm downloads](https://img.shields.io/npm/dm/zerodrop-client.svg)](https://www.npmjs.com/package/zerodrop-client)\n[![license](https://img.shields.io/npm/l/zerodrop-client.svg)](https://github.com/zerodrop-dev/zerodrop-sdk/blob/main/LICENSE)\n\nEmail verification infrastructure for CI pipelines and AI agents.\n\nSend a verification email. Catch it at the edge. Get `email.otp` and `email.magicLink` back — auto-extracted, no regex, no Docker, no signup.\n\n```javascript\nconst email = await mail.waitForLatest(inbox);\n\nemail.otp        // \"123456\" — auto-extracted\nemail.magicLink  // \"https://...\" — no regex needed\n```\n\n**[Documentation](https://docs.zerodrop.dev)** · [GitHub](https://github.com/zerodrop-dev) · [Status](https://zerodrop.instatus.com)\n\n## Install\n\n```bash\nnpm install zerodrop-client\n```\n\n## Test Isolation\n\nEvery inbox is isolated by default. `generateInbox()` returns a unique address on every call — no shared state, no pools, no configuration needed.\n\nZero cross-test contamination. Every test run gets a cryptographically isolated inbox that expires automatically after 30 minutes.\n\nThis means parallel CI builds work out of the box — 10 workers, 10 inboxes, zero race conditions.\n\n## Zero-Auth Mode (Local Development)\n\n```javascript\nimport { ZeroDrop } from 'zerodrop-client';\n\nconst mail = new ZeroDrop();\nconst inbox = mail.generateInbox();\n// → \"swift-x7k29@zerodrop-sandbox.online\"\n\nconst email = await mail.waitForLatest(inbox, { timeout: 10000 });\nconsole.log(email.subject);   // \"Reset your password\"\nconsole.log(email.otp);       // \"123456\" — auto-extracted, no regex needed\nconsole.log(email.magicLink); // \"https://...\" — auto-extracted verification link\n```\n\n## CI Pipeline Mode (Playwright / Cypress)\n\n```javascript\nimport { ZeroDrop } from 'zerodrop-client';\n\nconst mail = new ZeroDrop(process.env.ZERODROP_API_KEY);\n\ntest('password reset flow', async ({ page }) =\u003e {\n  const inbox = mail.generateInbox();\n\n  await page.goto('/forgot-password');\n  await page.fill('[name=\"email\"]', inbox);\n  await page.click('[type=\"submit\"]');\n\n  const email = await mail.waitForLatest(inbox, { timeout: 15000 });\n  expect(email.subject).toContain('Reset your password');\n\n  // No regex — magicLink is auto-extracted at the edge\n  await page.goto(email.magicLink);\n});\n```\n\n## OTP Auto-Extraction\n\nZeroDrop extracts OTP codes and magic links at the edge before emails reach your test suite. No regex required.\n\n```javascript\nconst email = await mail.waitForLatest(inbox);\n\n// Auto-extracted fields\nemail.otp        // \"123456\" — 4-8 digit verification code\nemail.magicLink  // \"https://app.com/verify?token=abc\" — verification/reset link\n\n// Raw body still available if you need it\nemail.body       // Full plain-text body\n```\n\nBoth fields are `null` if not detected in the email.\n\n## Email Filtering\n\nFilter emails by sender, subject, body, or extracted fields. Useful when multiple emails land in the same inbox.\n\n```javascript\n// Only match emails from a specific sender\nconst email = await mail.waitForLatest(inbox, {\n  filter: { from: 'noreply@yourapp.com' }\n});\n\n// Only match emails with a specific subject\nconst email = await mail.waitForLatest(inbox, {\n  filter: { subject: 'Verify your email' }\n});\n\n// Only match emails that contain an OTP\nconst email = await mail.waitForLatest(inbox, {\n  filter: { hasOtp: true }\n});\n\n// Only match emails that contain a magic link\nconst email = await mail.waitForLatest(inbox, {\n  filter: { hasMagicLink: true }\n});\n\n// Combine multiple filters\nconst email = await mail.waitForLatest(inbox, {\n  timeout: 15000,\n  filter: {\n    from: 'noreply@yourapp.com',\n    subject: 'Reset',\n    hasMagicLink: true\n  }\n});\n```\n\nAll string filters are case-insensitive partial matches.\n\n## Parallel CI Runs\n\nInbox generation is client-side — no API call, no throttling.\n50 parallel tests generate 50 inboxes instantly.\n\n```javascript\n// Safe to run in parallel — generateInbox() is local\nconst inboxes = Array.from({ length: 50 }, () =\u003e mail.generateInbox());\n```\n\nThe rate limit applies to the polling endpoint — 20 requests\nper 10 seconds per IP on the free tier. For heavy parallel\nusage, stagger `waitForLatest()` calls slightly:\n\n```javascript\n// Stagger polls to avoid burst on shared IP\nconst results = await Promise.all(\n  inboxes.map((inbox, i) =\u003e\n    new Promise(resolve =\u003e setTimeout(resolve, i * 100))\n      .then(() =\u003e mail.waitForLatest(inbox, { timeout: 15000 }))\n  )\n);\n```\n\nFor CI pipelines with 20+ parallel tests, use a Workspace\nAPI key — dedicated rate limit bucket, not shared with\nthe public pool.\n\n## Webhook Mode (Staging Servers)\n\n```javascript\nconst mail = new ZeroDrop(process.env.ZERODROP_API_KEY);\n\nawait mail.onReceived('qa-test@yourcompany.com', 'https://your-server.com/webhook');\n// ZeroDrop POSTs the email JSON to your URL when it arrives\n```\n\n## API\n\n### `new ZeroDrop(apiKey?, options?)`\n- `apiKey` — optional. Omit for free sandbox mode.\n- `options.baseUrl` — override the API base URL.\n\n### `mail.generateInbox(): string`\nReturns a ready-to-use email address instantly. No network request.\n\n### `mail.fetchLatest(inbox, filter?): Promise\u003cZeroDropEmail | null\u003e`\nReturns the latest email matching the filter, or null if inbox is empty.\n\n### `mail.waitForLatest(inbox, options?): Promise\u003cZeroDropEmail\u003e`\nUses SSE for sub-second email delivery. Falls back to polling automatically.\nThrows `ZeroDropTimeoutError` on timeout.\n- `options.timeout` — ms to wait (default: 10000)\n- `options.pollInterval` — ms between polls in fallback mode (default: 2000)\n- `options.sse` — set `false` to force polling mode (default: true)\n- `options.filter` — filter emails by sender, subject, body, otp, magicLink\n\n### `mail.onReceived(inbox, webhookUrl): Promise\u003c{ registered: boolean }\u003e`\nRegisters a webhook. Requires API key (Workspace tier).\n\n## Types\n\n```typescript\ninterface ZeroDropEmail {\n  id: string;\n  from: string;\n  to: string;\n  subject: string;\n  body: string;\n  rawBody: string;\n  receivedAt: Date;\n  otp: string | null;        // Auto-extracted OTP code (4-8 digits)\n  magicLink: string | null;  // Auto-extracted verification/reset link\n}\n\ninterface ZeroDropFilter {\n  from?: string;             // Partial match on sender address\n  subject?: string;          // Partial match on subject line\n  body?: string;             // Partial match on email body\n  hasOtp?: boolean;          // Only match emails with an extracted OTP\n  hasMagicLink?: boolean;    // Only match emails with an extracted magic link\n}\n```\n\n## Error Handling\n\n```javascript\nimport { ZeroDrop, ZeroDropTimeoutError } from 'zerodrop-client';\n\ntry {\n  const email = await mail.waitForLatest(inbox, { timeout: 10000 });\n} catch (err) {\n  if (err instanceof ZeroDropTimeoutError) {\n    console.error('No email received — check your app is sending correctly');\n  }\n}\n```\n\n## Free vs Workspace\n\n| | Free | Workspace |\n|---|---|---|\n| Inbox generation | ✓ | ✓ |\n| OTP auto-extraction | ✓ | ✓ |\n| Magic link extraction | ✓ | ✓ |\n| Email filtering | ✓ | ✓ |\n| Email retention | 30 min | Extended |\n| Custom domains | ✗ | ✓ |\n| API key | ✗ | ✓ |\n| Webhooks | ✗ | ✓ |\n| AI spam filter | On | Off |\n\nGet a Workspace at [zerodrop.dev](https://zerodrop.dev)\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerodrop-dev%2Fzerodrop-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzerodrop-dev%2Fzerodrop-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzerodrop-dev%2Fzerodrop-sdk/lists"}