{"_id":"@codebiter/emailspace","_rev":"4-966c1875a925c400ff5fb658a90fe1d2","name":"@codebiter/emailspace","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@codebiter/emailspace","version":"0.1.0","license":"MIT","_id":"@codebiter/emailspace@0.1.0","maintainers":[{"name":"codebiter","email":"abilashts@codebiter.app"}],"dist":{"shasum":"4b63a0196f2debbc27e867932c91c12ec7f6a46e","tarball":"https://registry.npmjs.org/@codebiter/emailspace/-/emailspace-0.1.0.tgz","fileCount":8,"integrity":"sha512-CBqlrxtqgXaR1jU66GoIj88m+sjDnlDRLNFsGUQ8QOU2vffsqjOnKe4pp9oWUnG9aBoYIMC5j1tN/YFP8oaY5Q==","signatures":[{"sig":"MEUCIQCW483WRsr9MyvGQ6bABrruQ0OYfmExpb1WCFuk8OGiMwIgRO6A/A1RS8osAz972OjEMgW/JnQVFiVDW6Uryv65y20=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34262},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"98d6342af22527eca7b051aec0903514f5563197","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup","test:watch":"vitest"},"_npmUser":{"name":"codebiter","email":"abilashts@codebiter.app"},"_npmVersion":"10.9.7","description":"Official EmailSpace SDK for sending templated email via AWS SES","directories":{},"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.9","typescript":"^5.8.2","@types/node":"^22.13.10"},"_npmOperationalInternal":{"tmp":"tmp/emailspace_0.1.0_1784195436784_0.39615747618568187","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@codebiter/emailspace","version":"0.1.1","license":"MIT","_id":"@codebiter/emailspace@0.1.1","maintainers":[{"name":"codebiter","email":"abilashts@codebiter.app"}],"dist":{"shasum":"51db2535592a556a3f80b6a0fde29a27be6a696b","tarball":"https://registry.npmjs.org/@codebiter/emailspace/-/emailspace-0.1.1.tgz","fileCount":8,"integrity":"sha512-A5llIwagIlb0LB9oU/uCc/Pl5NA+0dlF+UhLjTABBIlt3Dr2OB3bu/w8SG2yGnD3DaLVG6tIQgwYYSe9kN/7TQ==","signatures":[{"sig":"MEQCIGqyJJIvjIEdqVIhcF/Z3XW1Z3RiboP/z1ZOJDrt50b8AiBZIlURso+JqAkb5b9d2VTeqgHzC0NvN20vSD8N1Lznew==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34028},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"98d6342af22527eca7b051aec0903514f5563197","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup","test:watch":"vitest"},"_npmUser":{"name":"codebiter","email":"abilashts@codebiter.app"},"_npmVersion":"10.9.7","description":"Official EmailSpace SDK for sending templated email via AWS SES","directories":{},"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.9","typescript":"^5.8.2","@types/node":"^22.13.10"},"_npmOperationalInternal":{"tmp":"tmp/emailspace_0.1.1_1784197261731_0.707844326664566","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@codebiter/emailspace","version":"0.1.2","license":"MIT","_id":"@codebiter/emailspace@0.1.2","maintainers":[{"name":"codebiter","email":"abilashts@codebiter.app"}],"dist":{"shasum":"c92c008bca7ba2ae78d8236cd919ab187be0571f","tarball":"https://registry.npmjs.org/@codebiter/emailspace/-/emailspace-0.1.2.tgz","fileCount":8,"integrity":"sha512-FGkqoVLOlUIHk4GALLQSnXAEcDRlndz0jY/VawjT9diD3b0t5PWCTvBvY5p5GHU0WopCVkKxYmsYpb5KdKM/MA==","signatures":[{"sig":"MEQCICju/MumzcFvrTRzCMaRCmHGhmqJsnYiJBYG77y1LUDsAiAhIKRpdlVcSE9TuXRKaiTXfMzwsvDlvyT0GoV05H6bBQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":34297},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"98d6342af22527eca7b051aec0903514f5563197","scripts":{"lint":"tsc --noEmit","test":"vitest run","build":"tsup","test:watch":"vitest"},"_npmUser":{"name":"codebiter","email":"abilashts@codebiter.app"},"_npmVersion":"10.9.7","description":"Official EmailSpace SDK for sending templated email via AWS SES","directories":{},"_nodeVersion":"22.22.2","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.4.0","vitest":"^3.0.9","typescript":"^5.8.2","@types/node":"^22.13.10"},"_npmOperationalInternal":{"tmp":"tmp/emailspace_0.1.2_1784198556634_0.9243921539836797","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@codebiter/emailspace","version":"0.1.3","description":"Official EmailSpace SDK for sending templated email via AWS SES","license":"MIT","type":"module","main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","test":"vitest run","test:watch":"vitest","lint":"tsc --noEmit"},"engines":{"node":">=18"},"devDependencies":{"@types/node":"^22.13.10","tsup":"^8.4.0","typescript":"^5.8.2","vitest":"^3.0.9"},"_id":"@codebiter/emailspace@0.1.3","gitHead":"ccd315be1e1fb8bf454e3195f7b01f9f1d2124e7","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-FQYJrpCeZVG2F+CV5B0xfAO+mZJmw+wKDOI/dhR0yc/mvrxtAoI2nSrjaJEMoJZrzeYcQZwH0ib98C9DJMDHOw==","shasum":"c12873079774292a2ec9a57bb77952d2ed3fa64c","tarball":"https://registry.npmjs.org/@codebiter/emailspace/-/emailspace-0.1.3.tgz","fileCount":8,"unpackedSize":44034,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDQYvmSKwH2lq7xqlOZBIK7hQ/rJ6igj59qNoGAiIp6FAiEApMLooD4Ms/7yTrCTJAxZTvEUNrWRgOKFWXmKCK4H5gk="}]},"_npmUser":{"name":"codebiter","email":"abilashts@codebiter.app"},"directories":{},"maintainers":[{"name":"codebiter","email":"abilashts@codebiter.app"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/emailspace_0.1.3_1784823848125_0.7134018236704438"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-16T09:50:36.599Z","modified":"2026-07-23T16:24:08.436Z","0.1.0":"2026-07-16T09:50:36.914Z","0.1.1":"2026-07-16T10:21:01.867Z","0.1.2":"2026-07-16T10:42:36.785Z","0.1.3":"2026-07-23T16:24:08.274Z"},"license":"MIT","description":"Official EmailSpace SDK for sending templated email via AWS SES","maintainers":[{"name":"codebiter","email":"abilashts@codebiter.app"}],"readme":"# @codebiter/emailspace\n\nOfficial Node.js SDK for sending templated email through your project's connected **AWS SES** account.\n\nNo AWS credentials in your app — EmailSpace handles SES, delivery webhooks, and **Messages** history automatically.\n\n**Automations** and **Campaigns** run from the dashboard, not this SDK.\n\n> **[emailspace.codebiter.app](https://emailspace.codebiter.app/)** — Create a free account, connect AWS SES, and design email templates.\n\nRequires **Node.js 18+** (uses native `fetch`).\n\n## Install\n\n```bash\nnpm install @codebiter/emailspace\n```\n\n## Quickstart\n\n1. Connect **AWS SES** in the EmailSpace dashboard.\n2. Publish your template to SES.\n3. Create an **API key** under Project → API credentials.\n\n```typescript\nimport { EmailSpace } from '@codebiter/emailspace';\n\nconst emailSpace = new EmailSpace({\n  apiKey: process.env.EMAILSPACE_API_KEY!,\n});\n\nconst result = await emailSpace.send({\n  template: 'email_otp', // template slug or UUID from dashboard\n  to: 'john@example.com',\n  data: {\n    firstName: 'John',\n    offerCode: 'SPRING20',\n  },\n});\n\nconsole.log(result.messageId, result.acceptedRecipients);\n```\n\nSends appear in **Analytics → Messages** with delivery status updated from SES webhooks.\n\n## Send options\n\n```typescript\nawait emailSpace.send({\n  template: 'email_otp', // template slug or UUID\n  to: ['a@example.com', 'b@example.com'],\n  cc: ['manager@example.com'],\n  bcc: ['audit@example.com'],\n  data: { firstName: 'John' },\n  from: 'hello@yourdomain.com',       // optional override\n  fromName: 'Support Team',           // optional display name\n  replyTo: 'support@yourdomain.com',  // optional, string or string[]\n  attachments: [\n    { filename: 'invoice.pdf', content: '<base64>' },\n  ],                                    // optional, base64-encoded content\n});\n```\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `template` | Yes | Template slug or UUID from the dashboard (must be published to SES) |\n| `to` | Yes | Recipient email or array of emails |\n| `data` | No | Runtime template variables (`{{firstName}}`, etc.) |\n| `from` | No | Override the project default from address |\n| `fromName` | No | Display name for the from address |\n| `replyTo` | No | Reply-to address or array |\n| `attachments` | No | Array of `{ filename, content }` — base64-encoded file content. Supported by SES and SendGrid. |\n| `cc` / `bcc` | No | Additional recipients |\n\n## Send text / HTML without a template\n\nSend a plain text or HTML email directly without a pre-published template.\n\n```typescript\n// Plain text only\nawait emailSpace.sendText({\n  to: 'user@example.com',\n  subject: 'Welcome to EmailSpace',\n  text: 'Thank you for signing up!',\n});\n\n// HTML only\nawait emailSpace.sendText({\n  to: 'user@example.com',\n  subject: 'Welcome!',\n  html: '<h1>Welcome</h1><p>Thank you for signing up!</p>',\n});\n\n// Both (client falls back to text when HTML is not supported)\nawait emailSpace.sendText({\n  to: ['a@example.com', 'b@example.com'],\n  subject: 'Hello',\n  text: 'Plain text fallback',\n  html: '<h1>Hello</h1><p>Rich content</p>',\n  from: 'hello@yourdomain.com',\n  fromName: 'Support Team',\n});\n```\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `to` | Yes | Recipient email or array of emails |\n| `subject` | Yes | Email subject line |\n| `text` | No* | Plain text body |\n| `html` | No* | HTML body |\n| `from` | No | Override the project default from address |\n| `fromName` | No | Display name for the from address |\n| `replyTo` | No | Reply-to address or array |\n| `cc` / `bcc` | No | Additional recipients |\n| `attachments` | No | Array of `{ filename, content }` |\n\n\\* At least one of `text` or `html` is required.\n\n## Render\n\nPreview a template with data without sending an email.\n\n```typescript\nconst preview = await emailSpace.render({\n  template: 'email_otp', // template slug or UUID\n  data: { firstName: 'John' },\n});\n\nconsole.log(preview.subject);  // \"Welcome, John!\"\nconsole.log(preview.html);     // \"<html>...\"\n```\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `template` | Yes | Template UUID or slug |\n| `data` | No | Runtime template variables (`{{firstName}}`, etc.) |\n\nReturns `subject`, `html`, `templateId`, `name`, and `templateData`.\n\n## Configuration\n\n| Option | Required | Description |\n|--------|----------|-------------|\n| `apiKey` | Yes | Project API key (`es_live_…`) |\n| `fetch` | No | Custom fetch implementation (for testing) |\n\n## Errors\n\n```typescript\nimport { EmailSpaceError, EmailSpaceNetworkError } from '@codebiter/emailspace';\n\ntry {\n  await emailSpace.send({ ... });\n} catch (error) {\n  if (error instanceof EmailSpaceError) {\n    console.error(error.statusCode, error.code, error.message);\n  } else if (error instanceof EmailSpaceNetworkError) {\n    console.error('Network error', error.message);\n  }\n}\n```\n","readmeFilename":"README.md"}