technical · sourced answer
How to Get a Resend API Key for Email Sending
To get a Resend API key, sign up for a Resend account, navigate to the API Keys section in the dashboard, and click Create API Key. You will be prompted to name the key and select its permission level before the secret key is displayed once.
Account Setup
Begin by creating an account at resend.com. Once authenticated, you must verify your identity and email address to access the dashboard. New accounts typically start on a free tier which allows for a limited number of emails per day. Ensure your account is fully activated before attempting to generate credentials for your application.
Generating the Key
Navigate to the API Keys tab in the left sidebar of the Resend dashboard. Click the Create API Key button. You can assign a name to the key for organizational purposes, such as Production or Staging. You can choose between Full Access for all operations or Restricted Access to limit the key to specific actions. Once generated, copy the key immediately as it will not be shown again.
Implementing the Key
Store the API key in an environment variable such as RESEND_API_KEY to avoid hardcoding secrets in your source code. Use the Resend SDK for Node.js, Python, or other supported languages to initialize the client. Pass the key into the constructor to authenticate your requests. For those managing multiple domains, ensure the key has the necessary permissions to send from those verified domains.
Domain Verification
An API key alone is not sufficient for production sending. You must add your domain in the Domains section and configure the required DNS records. This involves adding TXT and CNAME records to your DNS provider to enable SPF and DKIM. You can use SendHQ free tools at https://sendhq.cc/tools to help manage your email infrastructure and technical setup.
Key Rotation and Security
If a key is compromised, revoke it immediately from the dashboard and generate a new one. Implement a rotation policy to update keys periodically. Avoid committing keys to public repositories like GitHub. Use a secrets manager or encrypted environment files to maintain the security of your transactional email pipeline.
Questions teams ask
Can I create multiple API keys?
Yes, Resend allows you to create multiple keys for different environments or team members to maintain granular control over access.
What happens if I lose my API key?
Resend does not store the plain text of the key after creation. If lost, you must delete the existing key and generate a new one.
Is there a cost to generate an API key?
Generating API keys is free. Costs are associated with the volume of emails sent based on the selected pricing plan.
Primary sources
- Resend Documentation — Resend
- Resend Pricing — Resend