@m13v/seo-components 0.9.0 → 0.9.1
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/package.json
CHANGED
|
@@ -75,6 +75,8 @@ export interface NewsletterConfig {
|
|
|
75
75
|
brand: string;
|
|
76
76
|
/** Site URL used in the default email template CTA link */
|
|
77
77
|
siteUrl: string;
|
|
78
|
+
/** Env var name for the Resend API key (default: "RESEND_API_KEY") */
|
|
79
|
+
apiKeyEnv?: string;
|
|
78
80
|
/** Override the welcome email subject line */
|
|
79
81
|
welcomeSubject?: string;
|
|
80
82
|
/**
|
|
@@ -100,13 +102,14 @@ export function createNewsletterHandler(config: NewsletterConfig) {
|
|
|
100
102
|
fromEmail,
|
|
101
103
|
brand,
|
|
102
104
|
siteUrl,
|
|
105
|
+
apiKeyEnv = "RESEND_API_KEY",
|
|
103
106
|
welcomeSubject,
|
|
104
107
|
welcomeHtml,
|
|
105
108
|
onSignup,
|
|
106
109
|
} = config;
|
|
107
110
|
|
|
108
111
|
return async function POST(req: NextRequest) {
|
|
109
|
-
const apiKey = process.env
|
|
112
|
+
const apiKey = process.env[apiKeyEnv];
|
|
110
113
|
if (!apiKey) {
|
|
111
114
|
return new Response(
|
|
112
115
|
JSON.stringify({ error: "Server configuration error" }),
|