Learn our suggested practices for handling API keys.
Create an environment variable
.env
file.Add the file to your gitignore
.env
file to your .gitignore
file to prevent it from being committed to version control. Many frameworks already add .env
to the .gitignore
file by default.Use the environment variable in your code
ts const resend = new Resend(process.env.RESEND_API_KEY);