This repository was archived by the owner on Nov 15, 2024. It is now read-only.
File tree 2 files changed +12
-0
lines changed
2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change 1
1
export STRIPE_SECRET_KEY=$BEAK_STRIPE_SECRET_KEY ;
2
2
export STRIPE_WEBHOOK_SECRET=$BEAK_STRIPE_WEBHOOK_SECRET ;
3
+ export MAILCHIMP_API_KEY=$BEAK_MAILCHIMP_API_KEY ;
3
4
export AWS_PROFILE=beak
Original file line number Diff line number Diff line change 1
1
import ksuid from '@cuvva/ksuid' ;
2
+ import mailchimpMarketing from '@mailchimp/mailchimp_marketing' ;
2
3
import type {
3
4
APIGatewayProxyEventV2 ,
4
5
APIGatewayProxyStructuredResultV2 ,
@@ -54,10 +55,19 @@ function getConfig(): Config {
54
55
55
56
const stpSecretKey = process . env . STRIPE_SECRET_KEY ;
56
57
const stpWebhookSecret = process . env . STRIPE_WEBHOOK_SECRET ;
58
+ const mailchimpApiKey = process . env . MAILCHIMP_API_KEY ;
57
59
58
60
if ( ! stpSecretKey || ! stpWebhookSecret )
59
61
throw new Squawk ( 'missing_stripe_config' ) ;
60
62
63
+ if ( ! mailchimpApiKey )
64
+ throw new Squawk ( 'mailchimp_api_key' ) ;
65
+
66
+ mailchimpMarketing . setConfig ( {
67
+ apiKey : mailchimpApiKey ,
68
+ server : 'us2' ,
69
+ } ) ;
70
+
61
71
return {
62
72
env,
63
73
jwtPrivateKey,
@@ -68,6 +78,7 @@ function getConfig(): Config {
68
78
stpSecretKey,
69
79
stpWebhookSecret,
70
80
stpSubscriptionPriceId : process . env . STRIPE_SUBSCRIPTION_PRICE_ID ?? 'price_1JhiGIATHKHpwoLyyxI5cCKU' ,
81
+ mailchimpApiKey,
71
82
} ;
72
83
}
73
84
You can’t perform that action at this time.
0 commit comments