{"id":47714952,"url":"https://github.com/lettr-com/lettr-node","last_synced_at":"2026-04-20T13:10:59.746Z","repository":{"id":343744627,"uuid":"1135103131","full_name":"lettr-com/lettr-node","owner":"lettr-com","description":"Official Node.js SDK and CLI for the Lettr email API","archived":false,"fork":false,"pushed_at":"2026-04-18T16:54:00.000Z","size":156,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-18T18:37:55.676Z","etag":null,"topics":["api","email","email-api","email-delivery","javascript","lettr","nodejs","npm","sdk","transactional-email","typescript"],"latest_commit_sha":null,"homepage":"https://lettr.com","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/lettr-com.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2026-01-15T16:34:24.000Z","updated_at":"2026-04-18T16:53:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/lettr-com/lettr-node","commit_stats":null,"previous_names":["lettr-com/lettr-node"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/lettr-com/lettr-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettr-com%2Flettr-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettr-com%2Flettr-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettr-com%2Flettr-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettr-com%2Flettr-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lettr-com","download_url":"https://codeload.github.com/lettr-com/lettr-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lettr-com%2Flettr-node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32048501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["api","email","email-api","email-delivery","javascript","lettr","nodejs","npm","sdk","transactional-email","typescript"],"created_at":"2026-04-02T18:51:18.753Z","updated_at":"2026-04-20T13:10:59.741Z","avatar_url":"https://github.com/lettr-com.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lettr Node.js SDK\n\nOfficial Node.js SDK and CLI tools for the [Lettr](https://lettr.com) transactional email service.\n\n## Packages\n\n| Package | Description |\n| --- | --- |\n| [`lettr`](./packages/lettr) | Core SDK — type-safe API client for sending emails, managing domains, templates, and webhooks |\n| [`lettr-kit`](./packages/lettr-kit) | CLI tool for managing Lettr email templates locally |\n\n## Quick Start\n\n### Install\n\n```bash\nnpm install lettr\n# or\nbun add lettr\n```\n\n### Send an Email\n\n```typescript\nimport { Lettr } from \"lettr\";\n\nconst client = new Lettr(\"lttr_your_api_key\");\n\nconst { data, error } = await client.emails.send({\n  from: \"sender@example.com\",\n  to: [\"recipient@example.com\"],\n  subject: \"Welcome!\",\n  html: \"\u003ch1\u003eHello!\u003c/h1\u003e\",\n});\n```\n\n### Send with a Template\n\nWhen using a template, `subject` is optional — the template's subject is used by default. You can pass `subject` to override it.\n\n```typescript\n// Subject defined by the template\nconst { data, error } = await client.emails.send({\n  from: \"sender@example.com\",\n  to: [\"recipient@example.com\"],\n  template_slug: \"welcome\",\n  substitution_data: { name: \"John\" },\n});\n\n// Override the template's subject\nconst { data, error } = await client.emails.send({\n  from: \"sender@example.com\",\n  to: [\"recipient@example.com\"],\n  template_slug: \"welcome\",\n  subject: \"Custom Subject\",\n  substitution_data: { name: \"John\" },\n});\n```\n\n### Error Handling\n\nAll methods return a `Result\u003cT\u003e` with discriminated `data` and `error` fields:\n\n```typescript\nconst { data, error } = await client.emails.send({ ... });\n\nif (error) {\n  // error.type is \"validation\" | \"api\" | \"network\"\n  console.error(error.message);\n  return;\n}\n\nconsole.log(data.request_id);\n```\n\n## API Reference\n\n```typescript\nconst client = new Lettr(\"lttr_...\");\n\n// Emails\nclient.emails.send(request)\nclient.emails.list(params?)\nclient.emails.get(requestId)\n\n// Domains\nclient.domains.list()\nclient.domains.create(domain)\nclient.domains.get(domain)\nclient.domains.delete(domain)\nclient.domains.verify(domain)\n\n// Templates\nclient.templates.list(params?)\nclient.templates.create(data)\nclient.templates.get(slug, projectId?)\nclient.templates.update(slug, data)\nclient.templates.delete(slug, projectId?)\nclient.templates.getMergeTags(slug, params?)\n\n// Webhooks\nclient.webhooks.list()\nclient.webhooks.get(webhookId)\n\n// Projects\nclient.projects.list(params?)\n\n// System\nclient.health()\nclient.authCheck()\n```\n\n## CLI (`lettr-kit`)\n\n```bash\nnpm install -g lettr-kit\n# or\nbunx lettr-kit\n```\n\n```bash\nlettr-kit init          # Interactive setup — creates lettr.json\nlettr-kit list          # List all templates with sync status\nlettr-kit pull          # Pull templates as HTML files\nlettr-kit pull --all    # Pull all templates without prompting\n```\n\n## Development\n\nThis is a monorepo using Bun workspaces.\n\n```bash\nbun install\nbun run build\nbun run test\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flettr-com%2Flettr-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flettr-com%2Flettr-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flettr-com%2Flettr-node/lists"}