buildConfig({ email }) to send authentication emails and application messages. The email option accepts only EmailPiece | Promise<EmailPiece>.
Configure Resend
Install the Resend piece in your FrogBot app:RESEND_API_KEY in your environment, then configure credentials and the default sender on the piece factory:
Resend has no OAuth recipe, so the factory does not accept
oauth. See factory options.
FrogBot uses the factory credentials for application email, including password resets and verification messages. It creates a request without a signed-in user for each send, so user connections do not supply email credentials. Missing factory credentials raise a ConnectionError naming the piece when you send.
Promised configuration
You can also pass a promise that resolves to the piece. With theresend instance above, use email: Promise.resolve(resend) in the config. FrogBot awaits the promise and validates the piece during initialization, before serving requests.
Send email
After FrogBot initializes, callfrogbot.email.sendEmail(...) wherever you have a FrogBot instance:
from is formatted as "Acme" <notifications@example.com> using the factory options. An explicit per-message from overrides that default:
{ address, name } objects, or arrays of either.
sendEmail also accepts the other fields of the standard mail options type, such as headers; the Resend piece ignores them.
Attach files
Provide each attachment’s contents as a string or a Node.jsBuffer. FrogBot converts the content to base64 for Resend. Strings use UTF-8 unless you supply an encoding; for an already-base64 string, set encoding: 'base64'.
Buffer. An attachment without string or Buffer content throws Piece 'resend' email attachments must be a string or Buffer before a request is sent.
Configuration errors
FrogBot rejects invalid email configuration during initialization. Direct pieces are validated while building the config; promised pieces are validated after they resolve.Delivery errors
The Resend piece sends a directfetch request to the Resend API. Non-success responses throw an error such as Resend request failed (422): <message>, using Resend’s message when available and the HTTP status text otherwise. Network failures also reject the send. There are no automatic retries; handle rejected sends in your application.
Without email
If you omitemail, FrogBot warns at startup and logs attempts to send email without delivering messages.