Use a test SMTP inbox to receive brkpt-auth emails during local development.
This recipe shows how to create a test SMTP inbox and use it to receive emails sent by brkpt-auth during local development.
Use this when a feature needs email delivery but you do not want to configure a real email provider yet.
Create a test SMTP account
Section titled “Create a test SMTP account”Open Ethereal and create a test account:
https://ethereal.email/createEthereal gives you SMTP credentials and a web inbox for captured test emails.
Configure SMTP variables
Section titled “Configure SMTP variables”Copy the generated SMTP credentials into your existing .env file:
SMTP_HOST="smtp.ethereal.email"SMTP_PORT="587"SMTP_USER="your-ethereal-username"SMTP_PASS="your-ethereal-password"SMTP_FROM="no-reply@example.test"Restart the NestJS server after changing .env.
Send a test email
Section titled “Send a test email”Trigger a brkpt-auth feature that sends email.
For example, if you completed Add OTP, send an OTP code:
POST /auth/otp/sendContent-Type: application/json
{ "target": "kevin@example.com", "method": "email"}Open the inbox
Section titled “Open the inbox”Open the Ethereal messages page:
https://ethereal.email/messagesFind the captured message and copy the verification value you need, such as an OTP code or a magic link.
Troubleshooting
Section titled “Troubleshooting”No message appears in the inbox.
Make sure the SMTP variables match the Ethereal account you created. Then restart the NestJS server and trigger the email flow again.
The SMTP credentials are missing.
Ethereal shows generated credentials only once. Create a new Ethereal account and update your .env file.
The message format is not what you want.
The email driver is source code in your project. Edit the relevant driver send method to customize the subject or body.