{"id":37503812,"url":"https://github.com/lettermint/lettermint-node","last_synced_at":"2026-05-11T09:55:29.856Z","repository":{"id":295312448,"uuid":"989561248","full_name":"lettermint/lettermint-node","owner":"lettermint","description":"Official Lettermint Node.js SDK","archived":false,"fork":false,"pushed_at":"2026-05-11T06:21:51.000Z","size":717,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-11T08:29:32.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://docs.lettermint.co/guides/send-email-with-nodejs","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lettermint.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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":"2025-05-24T10:56:03.000Z","updated_at":"2026-05-11T06:21:53.000Z","dependencies_parsed_at":"2025-05-24T20:41:48.407Z","dependency_job_id":"fc773580-71ce-4a99-be2e-614f76a793d0","html_url":"https://github.com/lettermint/lettermint-node","commit_stats":null,"previous_names":["lettermint/lettermint-node"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/lettermint/lettermint-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettermint%2Flettermint-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettermint%2Flettermint-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettermint%2Flettermint-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettermint%2Flettermint-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lettermint","download_url":"https://codeload.github.com/lettermint/lettermint-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettermint%2Flettermint-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32889971,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"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":[],"created_at":"2026-01-16T07:54:56.243Z","updated_at":"2026-05-11T09:55:29.839Z","avatar_url":"https://github.com/lettermint.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lettermint Node.js SDK\n\n![NPM Version](https://img.shields.io/npm/v/lettermint)\n![NPM Downloads](https://img.shields.io/npm/dm/lettermint)\n[![Join our Discord server](https://img.shields.io/discord/1305510095588819035?logo=discord\u0026logoColor=eee\u0026label=Discord\u0026labelColor=464ce5\u0026color=0D0E28\u0026cacheSeconds=43200)](https://lettermint.co/r/discord)\n\n\nThe official Node.js SDK for [Lettermint](https://lettermint.co).\n\n## Installation\n\n```bash\nnpm install lettermint\n```\n\n## Usage\n\n### Initialize the SDK\n\n```typescript\nimport { Lettermint } from \"lettermint\";\n\nconst lettermint = new Lettermint({\n    apiToken: \"your-api-token\"\n});\n```\n\n### Sending Emails\n\nThe SDK provides a fluent interface for sending emails:\n\n```typescript\nconst response = await lettermint.email\n  .from('sender@acme.com')\n  .to('recipient@acme.com')\n  .subject('Hello from Lettermint')\n  .text('This is a test email sent using the Lettermint Node.js SDK.')\n  .send();\n\nconsole.log(`Email sent with ID: ${response.message_id}`);\nconsole.log(`Status: ${response.status}`);\n```\n\n#### Advanced Email Options\n\n```typescript\nconst response = await lettermint.email\n  .from('John Doe \u003csender@acme.com\u003e')\n  .to('recipient1@acme.com', 'recipient2@acme.com')\n  .cc('cc@acme.com')\n  .bcc('bcc@acme.com')\n  .replyTo('reply@acme.com')\n  .subject('Hello from Lettermint')\n  .html('\u003ch1\u003eHello\u003c/h1\u003e\u003cp\u003eThis is an HTML email.\u003c/p\u003e')\n  .text('This is a plain text version of the email.')\n  .headers({\n    'X-Custom-Header': 'Custom Value',\n  })\n  .attach('attachment.txt', Buffer.from('Hello World').toString('base64'))\n  .attach('logo.png', Buffer.from('...').toString('base64'), 'logo') // Inline attachment\n  .idempotencyKey('unique-id-123')\n  .metadata({\n    foo: 'bar',\n  })\n  .tag('campaign-123')\n  .send();\n```\n\n## API Reference\n\n### Lettermint Class\n\nThe main entry point for the SDK.\n\n```typescript\nconst lettermint = new Lettermint({\n  apiToken: 'your-api-key',\n  baseUrl: 'https://api.lettermint.co/v1', // Optional\n  timeout: 30000, // Optional, in milliseconds\n});\n```\n\n### Email Endpoint\n\nMethods for sending emails:\n\n- `from(email: string)`: Set the sender email address\n- `to(...emails: string[])`: Set one or more recipient email addresses\n- `subject(subject: string)`: Set the email subject\n- `html(html: string | null)`: Set the HTML body of the email\n- `text(text: string | null)`: Set the plain text body of the email\n- `cc(...emails: string[])`: Set one or more CC email addresses\n- `bcc(...emails: string[])`: Set one or more BCC email addresses\n- `replyTo(...emails: string[])`: Set one or more Reply-To email addresses\n- `headers(headers: Record\u003cstring, string\u003e)`: Set custom headers for the email\n- `attach(filename: string, base64Content: string, content_id?: string)`: Attach a file to the email. Optional `content_id` for inline attachments.\n- `route(route: string)`: Set the routing key for the email\n- `idempotencyKey(key: string)`: Set an idempotency key to prevent duplicate email sends\n- `metadata(metadata: Record\u003cstring, string\u003e)`: Set metadata for the email\n- `tag(tag: string)`: Set a tag for the email\n- `send()`: Send the email and return a promise with the response\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flettermint%2Flettermint-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flettermint%2Flettermint-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flettermint%2Flettermint-node/lists"}