feat: allow overriding Resend API key and specifying from address via CLI flag#2978
feat: allow overriding Resend API key and specifying from address via CLI flag#2978josepjaume wants to merge 3 commits intoresend:canaryfrom
Conversation
Allow configuring the Resend API key directly via a CLI parameter on the dev command, which overrides the stored config from `resend setup`. This makes it easier to use in CI/scripted environments without running the interactive setup. https://claude.ai/code/session_01S5bPtnwuCfk37VUe6RFHT7
|
@claude is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
|
commit: |
When both --resend-api-key and --from are provided, the preview app sends test emails directly through the user's Resend account with the specified sender address, instead of the hosted react.email API. https://claude.ai/code/session_01S5bPtnwuCfk37VUe6RFHT7
There was a problem hiding this comment.
1 issue found across 9 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/preview-server/src/actions/send-email.ts">
<violation number="1" location="packages/preview-server/src/actions/send-email.ts:30">
P1: Custom agent: **API Key Permission Check SDK Methods**
This PR introduces a new Resend SDK method (`emails.send`) but does not include an explicit permission-readiness check/reminder for production API keys. Per the API Key Permission Check SDK Methods rule, confirm and document that deployed Resend keys have send-email permission before rollout to prevent runtime authorization failures.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
|
||
| const resend = new Resend(resendApiKey); | ||
|
|
||
| const response = await resend.emails.send({ |
There was a problem hiding this comment.
P1: Custom agent: API Key Permission Check SDK Methods
This PR introduces a new Resend SDK method (emails.send) but does not include an explicit permission-readiness check/reminder for production API keys. Per the API Key Permission Check SDK Methods rule, confirm and document that deployed Resend keys have send-email permission before rollout to prevent runtime authorization failures.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/preview-server/src/actions/send-email.ts, line 30:
<comment>This PR introduces a new Resend SDK method (`emails.send`) but does not include an explicit permission-readiness check/reminder for production API keys. Per the API Key Permission Check SDK Methods rule, confirm and document that deployed Resend keys have send-email permission before rollout to prevent runtime authorization failures.</comment>
<file context>
@@ -0,0 +1,43 @@
+
+ const resend = new Resend(resendApiKey);
+
+ const response = await resend.emails.send({
+ from: fromAddress,
+ to: [parsedInput.to],
</file context>
Description
This PR adds support for passing a Resend API key directly via a CLI flag (
--resend-api-key) to the dev command, allowing users to override the stored configuration without modifying their config file.Changes
--resend-api-key <key>option to the dev command CLI--from <address>option to the dev command CLIdevcommand handler to accept and pass through theresendApiKeyparameterstartDevServerto accept an optionalresendApiKeyparameterMotivation
This enables users to:
Test Plan
The change is straightforward and follows the existing pattern for CLI options. Verify that:
dev --resend-api-key <key>correctly passes the key to the preview serverhttps://claude.ai/code/session_01S5bPtnwuCfk37VUe6RFHT7
Summary by cubic
Add --resend-api-key and --from to the dev command to run the preview server with a custom Resend API key and sender. When both are set, test emails send directly via your Resend account instead of the hosted API; includes minor formatting fixes in preview-server components.
Written for commit 2b91d05. Summary will update on new commits.