RealComposer

SendGrid Safe & Unsafe Practices

Direct Answer

SendGrid API keys are server-only. Create restricted keys limited to Mail Send, authenticate your sending domain, and never expose an endpoint that lets callers choose arbitrary recipients or message bodies.

Credentials & Where They Belong

Server only
Restricted API key (SG.)

Limit to Mail Send for transactional sending.

Server only
Event Webhook verification key

Verifies signed event webhook deliveries.

Safe Practices

  • Use Mail Send only keys

    A leaked restricted key cannot read contacts or change account settings.

  • Send from templates with fixed recipients

    Derive the recipient from the authenticated user and fill dynamic template data on the server.

Unsafe Practices

  • Using a full access key for sending

    Full access keys can export contacts and create new keys.

  • Accepting to, subject, and HTML from the client

    This turns your domain into a spam and phishing relay.

The RealComposer Pattern

Store SENDGRID_API_KEY in the vault and build a POST pipeline with a fixed template ID so clients only supply safe dynamic fields.

START BUILDING FREE

Frequently Asked Questions

Q:Can I send SendGrid email from a frontend form?

Only through a server or edge proxy that holds the key and controls recipients and templates.

SendGrid Recipes

Multi-API Aggregation

Merge mailchimp campaigns with sendgrid stats

Campaign metadata from Mailchimp plus delivery stats from SendGrid. For "merge mailchimp campaigns with sendgrid stats", store MAILCHIMP_BASIC_AUTH, SENDGRID_API_KEY in Secret Vault, call https://{{secrets.MAILCHIMP_DC}}.api.mailchimp.com/3.0/lists/{{query.listId}}/members?count=10 from a Worker, and let Frontend / Web hit only https://realcomposer.com/v1/workspace/merge-mailchimp-with-sendgrid-stats with an rc_live_ client token.

Sub-10ms edgeView Recipe

Related Concepts