sently 0.10.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +42 -2
- package/README.md +21 -18
- package/SECURITY.md +59 -0
- package/dist/chunk-z1589fjk.js.map +1 -1
- package/dist/core/push-types.d.ts +1 -1
- package/dist/transports/mailpit.d.ts +166 -0
- package/dist/transports/mailpit.js +3 -0
- package/dist/transports/mailpit.js.map +10 -0
- package/package.json +15 -2
- package/site/content/docs/ai/llms-txt.mdx +47 -2
- package/site/content/docs/channels/email.mdx +3 -0
- package/site/content/docs/channels/index.mdx +3 -1
- package/site/content/docs/channels/push.mdx +4 -0
- package/site/content/docs/decorators/fallback.mdx +5 -0
- package/site/content/docs/decorators/index.mdx +2 -1
- package/site/content/docs/decorators/preview.mdx +52 -9
- package/site/content/docs/get-started/entrypoints.mdx +5 -3
- package/site/content/docs/get-started/index.mdx +8 -2
- package/site/content/docs/get-started/introduction.mdx +7 -3
- package/site/content/docs/get-started/meta.json +4 -1
- package/site/content/docs/get-started/migrate-nodemailer.mdx +132 -5
- package/site/content/docs/get-started/non-goals.mdx +57 -0
- package/site/content/docs/get-started/stability.mdx +69 -0
- package/site/content/docs/get-started/support-matrix.mdx +62 -0
- package/site/content/docs/guides/compare.mdx +87 -0
- package/site/content/docs/guides/failover.mdx +121 -0
- package/site/content/docs/guides/index.mdx +2 -0
- package/site/content/docs/guides/meta.json +2 -0
- package/site/content/docs/guides/security.mdx +38 -8
- package/site/content/docs/index.mdx +78 -4
- package/site/content/docs/meta.json +0 -1
- package/site/content/docs/reference/exports.mdx +5 -2
- package/site/content/docs/reference/push-options.mdx +14 -0
- package/site/content/docs/transports/fcm.mdx +8 -4
- package/site/content/docs/transports/index.mdx +9 -3
- package/site/content/docs/transports/mailpit.mdx +123 -0
- package/site/content/docs/transports/meta.json +1 -0
- package/site/content/docs/transports/smtp.mdx +61 -22
- package/site/content/docs/quick-start/email.mdx +0 -40
- package/site/content/docs/quick-start/index.mdx +0 -15
- package/site/content/docs/quick-start/meta.json +0 -5
- package/site/content/docs/quick-start/push.mdx +0 -53
- package/site/content/docs/quick-start/sms.mdx +0 -36
- package/site/content/docs/quick-start/whatsapp.mdx +0 -38
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Email
|
|
3
|
-
description: Send email through an HTTP transport.
|
|
4
|
-
icon: Mail
|
|
5
|
-
source: "src/mailer.ts"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<Callout title="The one rule">`createMailer` is asynchronous; await it before sending.</Callout>
|
|
9
|
-
|
|
10
|
-
<Steps>
|
|
11
|
-
<Step title="Create a transport-backed mailer">
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { createMailer } from "sently/mailer";
|
|
15
|
-
import { ResendTransport } from "sently/transports/resend";
|
|
16
|
-
|
|
17
|
-
const mailer = await createMailer({
|
|
18
|
-
transport: new ResendTransport({ apiKey: process.env.RESEND_API_KEY! }),
|
|
19
|
-
});
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
</Step>
|
|
23
|
-
<Step title="Send email">
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
await mailer.send({
|
|
27
|
-
from: "hello@example.com",
|
|
28
|
-
to: "person@example.com",
|
|
29
|
-
subject: "Welcome",
|
|
30
|
-
text: "Thanks for joining.",
|
|
31
|
-
});
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
</Step>
|
|
35
|
-
</Steps>
|
|
36
|
-
|
|
37
|
-
<Cards>
|
|
38
|
-
<Card title="Email channel" href="/docs/channels/email" />
|
|
39
|
-
<Card title="Resend transport" href="/docs/transports/resend" />
|
|
40
|
-
</Cards>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Quick start
|
|
3
|
-
description: Send your first message on each channel.
|
|
4
|
-
icon: Zap
|
|
5
|
-
source: "README.md"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Pick a channel and send in a few lines. Same model every time — sender, transport, send.
|
|
9
|
-
|
|
10
|
-
<Cards>
|
|
11
|
-
<Card title="Email" href="/docs/quick-start/email" />
|
|
12
|
-
<Card title="SMS" href="/docs/quick-start/sms" />
|
|
13
|
-
<Card title="WhatsApp" href="/docs/quick-start/whatsapp" />
|
|
14
|
-
<Card title="Push" href="/docs/quick-start/push" />
|
|
15
|
-
</Cards>
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Push
|
|
3
|
-
description: Send a Web Push or FCM notification through a channel sender.
|
|
4
|
-
icon: Bell
|
|
5
|
-
source: "src/push.ts"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
Send a browser Web Push or FCM device notification through `createPushSender`.
|
|
9
|
-
|
|
10
|
-
<Callout title="The one rule">
|
|
11
|
-
Use `subscription` with `WebPushTransport`, or `token` with `FcmTransport` — not both shapes on the wrong transport.
|
|
12
|
-
</Callout>
|
|
13
|
-
|
|
14
|
-
## Quick start
|
|
15
|
-
|
|
16
|
-
<Steps>
|
|
17
|
-
<Step title="Create a Web Push sender">
|
|
18
|
-
|
|
19
|
-
```ts
|
|
20
|
-
import { createPushSender } from "sently/push";
|
|
21
|
-
import { WebPushTransport } from "sently/transports/webpush";
|
|
22
|
-
|
|
23
|
-
const push = createPushSender({
|
|
24
|
-
transport: new WebPushTransport({
|
|
25
|
-
vapidPublicKey: process.env.VAPID_PUBLIC_KEY!,
|
|
26
|
-
vapidPrivateKey: process.env.VAPID_PRIVATE_KEY!,
|
|
27
|
-
subject: "mailto:you@example.com",
|
|
28
|
-
}),
|
|
29
|
-
});
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
</Step>
|
|
33
|
-
<Step title="Send">
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
await push.send({
|
|
37
|
-
subscription,
|
|
38
|
-
title: "Update",
|
|
39
|
-
body: "Your report is ready.",
|
|
40
|
-
});
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
</Step>
|
|
44
|
-
</Steps>
|
|
45
|
-
|
|
46
|
-
For FCM device tokens, use `FcmTransport` and `token` instead of `subscription` — see [FCM](/docs/transports/fcm).
|
|
47
|
-
|
|
48
|
-
## Next
|
|
49
|
-
|
|
50
|
-
<Cards>
|
|
51
|
-
<Card title="Push channel" href="/docs/channels/push" />
|
|
52
|
-
<Card title="FCM transport" href="/docs/transports/fcm" />
|
|
53
|
-
</Cards>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: SMS
|
|
3
|
-
description: Send an SMS through a channel sender.
|
|
4
|
-
icon: MessageSquareText
|
|
5
|
-
source: "src/sms.ts"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<Callout title="The one rule">Create the SMS sender once, then call `send` with `to` and `body`.</Callout>
|
|
9
|
-
|
|
10
|
-
<Steps>
|
|
11
|
-
<Step title="Create the sender">
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { createSmsSender } from "sently/sms";
|
|
15
|
-
import { TwilioSmsTransport } from "sently/transports/twilio-sms";
|
|
16
|
-
|
|
17
|
-
const sms = createSmsSender({
|
|
18
|
-
transport: new TwilioSmsTransport({
|
|
19
|
-
accountSid: process.env.TWILIO_ACCOUNT_SID!,
|
|
20
|
-
authToken: process.env.TWILIO_AUTH_TOKEN!,
|
|
21
|
-
from: "+15557654321",
|
|
22
|
-
}),
|
|
23
|
-
});
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
</Step>
|
|
27
|
-
<Step title="Send">
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
await sms.send({ to: "+15551234567", body: "Your code is ready." });
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
</Step>
|
|
34
|
-
</Steps>
|
|
35
|
-
|
|
36
|
-
<Cards><Card title="SMS channel" href="/docs/channels/sms" /></Cards>
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: WhatsApp
|
|
3
|
-
description: Send a WhatsApp message through a channel sender.
|
|
4
|
-
icon: MessagesSquare
|
|
5
|
-
source: "src/whatsapp.ts"
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
<Callout title="The one rule">Use a template outside the open customer-service window; use free text only inside it.</Callout>
|
|
9
|
-
|
|
10
|
-
<Steps>
|
|
11
|
-
<Step title="Create the sender">
|
|
12
|
-
|
|
13
|
-
```ts
|
|
14
|
-
import { createWhatsAppSender } from "sently/whatsapp";
|
|
15
|
-
import { WhatsAppCloudTransport } from "sently/transports/whatsapp-cloud";
|
|
16
|
-
|
|
17
|
-
const whatsapp = createWhatsAppSender({
|
|
18
|
-
transport: new WhatsAppCloudTransport({
|
|
19
|
-
accessToken: process.env.WHATSAPP_TOKEN!,
|
|
20
|
-
phoneNumberId: process.env.WHATSAPP_PHONE_NUMBER_ID!,
|
|
21
|
-
}),
|
|
22
|
-
});
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
</Step>
|
|
26
|
-
<Step title="Send a template">
|
|
27
|
-
|
|
28
|
-
```ts
|
|
29
|
-
await whatsapp.send({
|
|
30
|
-
to: "15551234567",
|
|
31
|
-
template: { name: "welcome", language: "en_US" },
|
|
32
|
-
});
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
</Step>
|
|
36
|
-
</Steps>
|
|
37
|
-
|
|
38
|
-
<Cards><Card title="WhatsApp channel" href="/docs/channels/whatsapp" /></Cards>
|