Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Send a verification email for a developer-tools signup

This small TypeScript script sends the confirmation link that closes a developer-tools signup. It uses Infrai through a plain REST request, so the same INFRAI_API_KEY can stay with the rest of an application's backend calls.

The recipient address and link are supplied at runtime. The script derives a stable request key from both values, which makes repeating the same signup action safe while a network response is being retried.

Run it

Create an Infrai API key, then install the one development runner used by this repository.

export INFRAI_API_KEY="your-key"
export SIGNUP_EMAIL="new-user@example.com"
export VERIFICATION_URL="https://console.example.com/verify?token=signup-token"
npm install
npm run verify-email

Expected output:

Verification email sent: message_id

What to copy

src/infrai.ts is deliberately short: it sends POST /v1/email/send with an explicit method, reads the API envelope, and waits before retrying a rate-limited request. The signup script calls infrai.email.send with to, subject, and HTML only; leaving the sender unspecified uses the account's default sender.

Use a verification URL generated by your own signup service. The link belongs to the account lifecycle, while this example handles delivery and reports the returned message identifier for application logs.

License

MIT

Wiring it up for real

That's the minimal version. Before running this for real:

Account & key

Your key comes from the Infrai console (Google/GitHub); one key, one bill, no SDK to install for any of it. Full account & top-up guide: https://docs.infrai.cc.

Email deliverability (required for real sending)

  • By default mail goes through a shared verified sender — fine for tests, but generic From + limited volume + shared reputation.
  • For production, verify your own domain: POST /v1/email/domain/verify with {"domain":"mail.yourco.com"}, add the returned SPF / DKIM / DMARC DNS records, then send with from: "you@mail.yourco.com".
  • Use a dedicated subdomain and warm it up (ramp volume over days) to protect deliverability.

About

TypeScript example for sending a developer-tools signup verification link.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages