What are all these keys and how are these used?
Dashboard:
publishable_keysecret_keyrestricted_keywebhook_signing_secret
The first 3 are visible in Dashboard.
Where are all these keys used?
What I've found out through trial and error: (I don't know how this would look like in production)
Decoding the event while CLI is running:
Webhook.constructEvent(rawRequestBody, signature, WEBHOOK_SIGNING_SECRET)
Setting API key globally
Stripe.apiKey = SECRET_KEY
My question are:
- since there is no
Stripe CLIrunning in prod, is thewebhook_signing_secretthe same as thesecret_key? (event is not forwarded through theCLI) - why can't the
Stripe CLIcreate an event with the signing secret encoded? it has already thepublishable_keyandsecret_keys configured, why does it need a new one? - where is the
restricted_keyused?