{"_id":"@bencetotht/simplemailer","_rev":"2-48be5c44d3f82d8cf7be9fe84ed85d48","name":"@bencetotht/simplemailer","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@bencetotht/simplemailer","version":"0.1.0","license":"MIT","_id":"@bencetotht/simplemailer@0.1.0","maintainers":[{"name":"bencetotht","email":"tothbencetamas@gmail.com"}],"homepage":"https://github.com/bencetotht/simplemailer#readme","bugs":{"url":"https://github.com/bencetotht/simplemailer/issues"},"dist":{"shasum":"b181113e43dd959bf9fb291ffec469b4fb0f10eb","tarball":"https://registry.npmjs.org/@bencetotht/simplemailer/-/simplemailer-0.1.0.tgz","fileCount":30,"integrity":"sha512-GGkcIO7HdksaBgpwJEfT4o1GE+uh1XeteYrFh8dpQDBtlMm411V6g3qmH6n6TppBk3/R1STQYIkMQ0vd+bYVeQ==","signatures":[{"sig":"MEYCIQCkQPr1ulLYwn62Yil5CnYWpuW5HEZtiLDFi70D3AvW5gIhAPWTpNH3detR/IdXBLrMCDc3PzkH2Dfbx/udDvETHegs","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":61799},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22 <25"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./nest":{"types":"./dist/nest.d.ts","import":"./dist/nest.js"},"./sync":{"types":"./dist/sync.d.ts","import":"./dist/sync.js"},"./contracts":{"types":"./dist/contracts.d.ts","import":"./dist/contracts.js","default":"./dist/contracts.js"}},"gitHead":"b1d68f515df13a02766f24350f634c3e571fe2e9","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","prepack":"pnpm build","type-check":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"bencetotht","email":"tothbencetamas@gmail.com"},"repository":{"url":"git+https://github.com/bencetotht/simplemailer.git","type":"git","directory":"packages/sdk"},"_npmVersion":"11.17.0","description":"Type-safe, server-side SDK for the SimpleMailer API","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","dependencies":{"zod":"^3.25.76","zod-to-json-schema":"^3.24.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.9.2","@types/node":"^24.2.0"},"_npmOperationalInternal":{"tmp":"tmp/simplemailer_0.1.0_1786297385465_0.8985430515117692","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@bencetotht/simplemailer","version":"0.1.1","description":"Type-safe, server-side SDK for the SimpleMailer API","repository":{"type":"git","url":"git+https://github.com/bencetotht/simplemailer.git","directory":"packages/sdk"},"homepage":"https://github.com/bencetotht/simplemailer#readme","bugs":{"url":"https://github.com/bencetotht/simplemailer/issues"},"type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./nest":{"types":"./dist/nest.d.ts","import":"./dist/nest.js"},"./sync":{"types":"./dist/sync.d.ts","import":"./dist/sync.js"},"./contracts":{"types":"./dist/contracts.d.ts","import":"./dist/contracts.js","default":"./dist/contracts.js"}},"scripts":{"build":"tsc -p tsconfig.build.json","prepack":"pnpm build","type-check":"tsc -p tsconfig.json --noEmit","test":"vitest run","clean":"rm -rf dist"},"engines":{"node":">=22 <25"},"dependencies":{"zod":"^3.25.76","zod-to-json-schema":"^3.24.6"},"devDependencies":{"@types/node":"^24.2.0","typescript":"^5.9.2","vitest":"^3.2.4"},"publishConfig":{"access":"public"},"license":"MIT","gitHead":"b0548aef83a8fa8cbd8b8a2c71d726f529334e2b","_id":"@bencetotht/simplemailer@0.1.1","_nodeVersion":"22.23.1","_npmVersion":"11.15.0","dist":{"integrity":"sha512-d/vm2+Oa2sM74VrrVoImTz7owHFqO/W9/C/Mb0wdIrX+cXRZqrzYB1xH7c4xNCZfVEPPm07/Gnz27S+rPwWEDg==","shasum":"c934bb9713ab3e7bddd323bdd58e8792093e0462","tarball":"https://registry.npmjs.org/@bencetotht/simplemailer/-/simplemailer-0.1.1.tgz","fileCount":34,"unpackedSize":140448,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFQ4QlAMLJG8BlQduW51+vmpsGMkYMPgrREonPmBAiZ6AiEAtH+1xBePelfPUfWgX8iPt1Jz+/E7YLBRs+YsSNhfP48="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:54d027b3-c5eb-4034-bf9f-bcee6fe5a37d"}},"directories":{},"maintainers":[{"name":"bencetotht","email":"tothbencetamas@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/simplemailer_0.1.1_1786303764018_0.5819654289637017"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-09T17:43:05.279Z","modified":"2026-08-09T19:29:24.284Z","0.1.0":"2026-08-09T17:43:05.604Z","0.1.1":"2026-08-09T19:29:24.163Z"},"bugs":{"url":"https://github.com/bencetotht/simplemailer/issues"},"license":"MIT","homepage":"https://github.com/bencetotht/simplemailer#readme","repository":{"type":"git","url":"git+https://github.com/bencetotht/simplemailer.git","directory":"packages/sdk"},"description":"Type-safe, server-side SDK for the SimpleMailer API","maintainers":[{"name":"bencetotht","email":"tothbencetamas@gmail.com"}],"readme":"# SimpleMailer SDK\n\nServer-side, ESM-only TypeScript SDK for SimpleMailer. It supports Node.js\n22–24 and has no framework dependency. It also exports the runtime Zod\nvalidators, public API types, and JSON schemas shared with the server.\n\nConsumers that only need those definitions can import them from the dedicated\n`@bencetotht/simplemailer/contracts` subpath without installing another package.\n\n```ts\nimport { SimpleMailer } from \"@bencetotht/simplemailer\";\n\nconst mailer = new SimpleMailer({\n  baseUrl: process.env.SIMPLEMAILER_URL!,\n  apiKey: process.env.SIMPLEMAILER_API_KEY!,\n});\n\nawait mailer.messages.send(\n  {\n    sender: \"transactional\",\n    to: \"person@example.com\",\n    subject: \"Welcome\",\n    content: { html: \"<p>Welcome</p>\", text: \"Welcome\" },\n  },\n  {\n    idempotencyKey: \"welcome:user_123\",\n    retry: true,\n    timeoutMs: 5_000,\n  },\n);\n```\n\nAutomatic retries are bounded to five attempts and a `POST` is never retried\nunless it has an idempotency key. `SimpleMailerError` exposes `status`, `code`,\n`details`, `requestId`, `retryAfterMs`, and `retryable`.\n\nDo not instantiate this SDK in browser code or expose its API key through a\n`NEXT_PUBLIC_*` variable. React Email should be rendered in the consuming\nserver application; pass only the resulting HTML and text to `messages.send`.\n\nControl-plane keys with webhook scopes can manage signed endpoints:\n\n```ts\nconst { endpoint, secret } = await mailer.webhooks.create({\n  url: \"https://app.example.com/webhooks/simplemailer\",\n  events: [\"message.sent\", \"message.delivery_uncertain\"],\n});\n\n// Persist `secret` now: SimpleMailer will not return it again.\nawait mailer.webhooks.test(endpoint.id);\n```\n\nThe client also exposes `webhooks.list`, `update`, `rotateSecret`, and `replay`.\nWebhook mutation methods are not automatically retried; callers should inspect\nthe resulting resource or event delivery before repeating a control-plane\noperation.\n\nControl-plane keys with `keys:read` and `keys:write` can create and revoke\nproject credentials through `apiKeys`. A newly generated secret is returned\nonly by `apiKeys.create`; store it before discarding the response. The API\nrejects revoking the credential used for the request so rotation cannot\naccidentally lock out the caller.\n\n## NestJS\n\nThe optional `@bencetotht/simplemailer/nest` entry point supplies a stable injection\ntoken and provider helpers without making `@nestjs/common` a dependency:\n\n```ts\nimport { Module } from \"@nestjs/common\";\nimport {\n  SIMPLEMAILER,\n  createSimpleMailerProvider,\n} from \"@bencetotht/simplemailer/nest\";\n\n@Module({\n  providers: [\n    createSimpleMailerProvider({\n      baseUrl: process.env.SIMPLEMAILER_URL!,\n      apiKey: process.env.SIMPLEMAILER_API_KEY!,\n    }),\n  ],\n  exports: [SIMPLEMAILER],\n})\nexport class MailModule {}\n```\n\nThe core client also accepts an `HttpTransport`, making it straightforward to\nreplace with a fake in unit tests.\n\n## Declarative resources\n\n`defineMailer`, `resolveMailerDefinition`, `diffMailerDefinition`, and\n`applyMailerSync` provide a typed, deterministic synchronization engine.\nManifests contain template paths and environment-variable secret references;\nresolved secret values are not emitted by diff plans.\n\nSender and immutable managed-template plans can be diffed and applied against\nthe current project-scoped management endpoints. Managed-template sending and\nsafe MJML compilation remain separate server capabilities and are not implied\nby successful synchronization.\n","readmeFilename":"README.md"}