Context
Currently apps/web/api/webhook.ts generates an API key on purchase but has no way to deliver it to the user. The plaintext key is only available at generation time — after that, only the hash is stored.
TODO from code
// TODO: Send API key to user via email (Resend/Postmark) instead of returning it
Proposed solution
Integrate Resend or Postmark to email the API key to the customer after a successful Polar.sh purchase webhook.
Files
apps/web/api/webhook.ts (line 177)
Context
Currently
apps/web/api/webhook.tsgenerates an API key on purchase but has no way to deliver it to the user. The plaintext key is only available at generation time — after that, only the hash is stored.TODO from code
// TODO: Send API key to user via email (Resend/Postmark) instead of returning itProposed solution
Integrate Resend or Postmark to email the API key to the customer after a successful Polar.sh purchase webhook.
Files
apps/web/api/webhook.ts(line 177)