You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every method returns a `Result<T>` (`{ data, error }`) — the SDK never throws for API or network failures.
77
38
78
-
```typescript
79
-
const client =newLettr("lttr_...");
80
-
81
-
// Emails
82
-
client.emails.send(request)
83
-
client.emails.list(params?)
84
-
client.emails.get(requestId)
85
-
86
-
// Domains
87
-
client.domains.list()
88
-
client.domains.create(domain)
89
-
client.domains.get(domain)
90
-
client.domains.delete(domain)
91
-
client.domains.verify(domain)
92
-
93
-
// Templates
94
-
client.templates.list(params?)
95
-
client.templates.create(data)
96
-
client.templates.get(slug, projectId?)
97
-
client.templates.update(slug, data)
98
-
client.templates.delete(slug, projectId?)
99
-
client.templates.getMergeTags(slug, params?)
100
-
101
-
// Webhooks
102
-
client.webhooks.list()
103
-
client.webhooks.get(webhookId)
104
-
105
-
// Projects
106
-
client.projects.list(params?)
107
-
108
-
// System
109
-
client.health()
110
-
client.authCheck()
111
-
```
39
+
## Documentation
40
+
41
+
📚 **[docs.lettr.com/quickstart/nodejs](https://docs.lettr.com/quickstart/nodejs/introduction)** — full guides for sending, templates, domains, webhooks, audience, and campaigns, plus the [API reference](https://docs.lettr.com/api-reference/introduction).
Copy file name to clipboardExpand all lines: packages/lettr/README.md
+19-36Lines changed: 19 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,20 @@
1
1
# Lettr Node.js SDK
2
2
3
-
Official Node.js SDK for the [Lettr](https://lettr.com) transactional email API.
3
+
Official Node.js SDK for the [Lettr](https://lettr.com) transactional email API. Type-safe client that returns a `Result` (`{ data, error }`) instead of throwing — covers emails, templates, domains, webhooks, audience, and campaigns.
Every method returns a `Result<T>` — destructure `{ data, error }` and handle `error` before reading `data`. The SDK never throws for API or network failures.
33
35
34
-
List, retrieve, and act on campaigns under `client.campaigns`:
36
+
## Documentation
35
37
36
-
```typescript
37
-
// List sent campaigns
38
-
const { data } =awaitclient.campaigns.list({ status: "sent" });
0 commit comments