Access is invite-only during beta. Once invited, create a key to personalize these examples. Production sending requires a separate review.
Send emails with NestJS
Import PostShibaModule and call sendMail.
The Nest entry is a module and an injectable token, not a mailer. Import postshiba without Nest. Import postshiba/nest only in Nest apps. sendMail maps to, from, subject, html, text, and attachments onto emails.send.
Node 18 or later. Open pull requests on postshiba/sdks.
Errors and throttling
Failed responses throw PostShibaError with error, field, and message.
A 429 with error throttled means the cluster hit its hourly throttle or its 24-hour cap. Do not retry that send immediately. Immediate retries hit the same cap.
The Nest module does not delay for you. In a queued job, catch PostShibaError and check err.error === "throttled" before sending again.
See Errors.