Skip to content

Commit 2497d6d

Browse files
committed
docs: link Cloudflare Email domain setup
1 parent f20eb46 commit 2497d6d

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,8 @@ export const auth = createAuth();
288288
export { createAuth };
289289
```
290290

291+
> Cloudflare Email Sending requires the `from` address to use an onboarded domain. Configure the sender domain in [Cloudflare Email Service domains](https://developers.cloudflare.com/email-service/configuration/domains/) before deploying real emails.
292+
291293
The `baseURL` is derived per-request in Hono middleware via `new URL(c.req.url).origin`. On Cloudflare Workers, `request.url` reflects the actual URL the client connected to — Cloudflare's edge routes requests to your worker based on DNS and [route configuration](https://developers.cloudflare.com/workers/configuration/routing/routes/), not the HTTP `Host` header alone. Alternatively, you can set the `BETTER_AUTH_URL` environment variable and omit the `baseURL` parameter.
292294

293295
**For OpenNext.js with complex async requirements:**

cli/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ The migrate command automatically detects your database configuration from `wran
9292

9393
**R2 Integration**: Enables file upload and management capabilities. See [R2 setup guide](../docs/r2.md) for detailed configuration and usage.
9494

95-
**Email Integration**: Adds a Cloudflare Email Sending binding and wires Better Auth verification and password reset callbacks. The sender address must use a domain configured in Cloudflare Email Service.
95+
**Email Integration**: Adds a Cloudflare Email Sending binding and wires Better Auth verification and password reset callbacks. The sender address must use a domain configured in [Cloudflare Email Service](https://developers.cloudflare.com/email-service/configuration/domains/).
9696

9797
### Database-specific arguments
9898

docs/configuration.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -206,15 +206,15 @@ withCloudflare(
206206

207207
### `CloudflareEmailConfig`
208208

209-
| Field | Type | Default | Description |
210-
| ------------------------- | ------------------------- | ----------- | --------------------------------------------------------------------------------- |
211-
| `binding` | `SendEmail` | Required | Cloudflare Email Sending binding from `wrangler.toml`. |
212-
| `from` | `string \| EmailAddress` | Required | Default sender address. The domain must be onboarded in Cloudflare Email Service. |
213-
| `replyTo` | `string \| EmailAddress` | `undefined` | Optional default Reply-To address. |
214-
| `sendVerificationEmail` | `boolean` | `true` | Set to `false` to avoid auto-wiring Better Auth email verification. |
215-
| `sendResetPassword` | `boolean` | `true` | Set to `false` to avoid auto-wiring Better Auth password reset emails. |
216-
| `templates.verification` | `CloudflareEmailTemplate` | Built-in | Optional custom verification email subject/body template. |
217-
| `templates.passwordReset` | `CloudflareEmailTemplate` | Built-in | Optional custom password reset subject/body template. |
209+
| Field | Type | Default | Description |
210+
| ------------------------- | ------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
211+
| `binding` | `SendEmail` | Required | Cloudflare Email Sending binding from `wrangler.toml`. |
212+
| `from` | `string \| EmailAddress` | Required | Default sender address. The domain must be onboarded in [Cloudflare Email Service](https://developers.cloudflare.com/email-service/configuration/domains/). |
213+
| `replyTo` | `string \| EmailAddress` | `undefined` | Optional default Reply-To address. |
214+
| `sendVerificationEmail` | `boolean` | `true` | Set to `false` to avoid auto-wiring Better Auth email verification. |
215+
| `sendResetPassword` | `boolean` | `true` | Set to `false` to avoid auto-wiring Better Auth password reset emails. |
216+
| `templates.verification` | `CloudflareEmailTemplate` | Built-in | Optional custom verification email subject/body template. |
217+
| `templates.passwordReset` | `CloudflareEmailTemplate` | Built-in | Optional custom password reset subject/body template. |
218218

219219
### `createEmailSender(config)`
220220

@@ -236,7 +236,7 @@ await sendEmail({
236236
});
237237
```
238238

239-
At least one of `text` or `html` is required. Cloudflare Email Service requires the `from` domain to be configured for Email Sending.
239+
At least one of `text` or `html` is required. Cloudflare Email Service requires the `from` domain to be [configured for Email Sending](https://developers.cloudflare.com/email-service/configuration/domains/).
240240

241241
---
242242

0 commit comments

Comments
 (0)