Skip to content

Add optional RESEND_BASE_URL component env var - #169

Merged
convexwill merged 12 commits into
mainfrom
will/api-89-resend-support-baseurl
Dec 5, 2026
Merged

convexwill merged 12 commits into
mainfrom
will/api-89-resend-support-baseurl

Conversation

@convexwill

@convexwill convexwill commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Adds an optional RESEND_BASE_URL component env var so batches can go to a Resend-compatible API, such as a local emulator in e2e tests. Unset means https://api.resend.com.

const app = defineApp({
  env: {
    RESEND_API_KEY: v.string(),
    RESEND_BASE_URL: v.optional(v.string()),
  },
});
app.use(resend, {
  env: {
    RESEND_API_KEY: app.env.RESEND_API_KEY,
    RESEND_BASE_URL: app.env.RESEND_BASE_URL,
  },
});

Based on #130 by heracek, but it uses component env instead of a baseUrl client option.

Tests cover the custom URL (with and without a trailing slash) and the default. I also checked it on a local deployment.

🤖 Generated with Claude Code

Will Stockwell and others added 6 commits December 4, 2026 13:26
Lets the component send batches to a Resend-compatible API, such as a
local emulator in end-to-end tests, instead of https://api.resend.com.
Based on #130, which added a baseUrl client option; this reads it from
component env instead, so the app opts in by binding it in
convex.config.ts. Trailing slashes are stripped.

Co-authored-by: heracek <tomas.horacek@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deployments that don't receive webhooks shouldn't need the secret to
deploy. Matches the example app and the changeset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 8 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread README.md Resolved
Will Stockwell and others added 6 commits December 4, 2026 16:41
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The component supports a trailing slash. The resend SDK is the app's own
client, outside what this component controls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The component strips a trailing slash, but the SDK appends paths to the
value as is, so manual sends need it without one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-new Bot commented Dec 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@convex-dev/resend@169

commit: 6da74b1

@convexwill
convexwill merged commit be7aa98 into main Dec 5, 2026
3 checks passed
@github-actions github-actions Bot mentioned this pull request Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants