Skip to content
Community forum

Keeping Stripe and SendGrid keys out of the frontend

SolvedSupero SupportSupero team asked

Common question, written up by the Supero team.

Our app sends receipts through SendGrid and takes payments through Stripe. Right now the keys sit in a config file the frontend loads. Where should they live?

Link

1 answer

Accepted answer
Accepted answer

Provider credentials belong in the service's config on the platform, not in your app's files. Set them with PUT /api/v1/services/{service_id}/config (the field names per provider are listed on the managed integrations page). Fields the catalog marks as secret are stored encrypted and come back masked on read. Your frontend then calls the operation by service name and never holds the key:

js
await client.transactional.execute('email', 'send_email', {
  to_email: 'customer@example.com',
  subject: 'Your receipt',
  body_html: '<p>Thanks for your order.</p>',
});

Moving from test to live keys later is a config change, not a code change.

Supero API keys used by your own backend or CI follow the same idea. The full value is shown once at creation, so put it in a secrets manager or environment variable, never in source control. Give each key an expiry with expires_in_days, and rotate any key that has been in a screenshot, a support ticket, a CI log or a repository.

Supero Platform teamSupero team answered
Link

Your answer

Keeping Stripe and SendGrid keys out of the frontend | Supero Community