@baxcloud/parse-server-baxmail
v1.0.2
Published
Parse Server email adapter for BaxMail — verification and password reset emails
Downloads
367
Maintainers
Readme
@baxcloud/parse-server-baxmail
Parse Server email adapter for BaxMail. Send email verification, password reset, and custom transactional mail through your BaxCloud project — API keys stay on Parse Server only.
For BaxMail webhook verification (and other BaxCloud product webhooks), use @baxcloud/baxcloud-server-sdk on your server alongside this adapter.
Product-specific SDKs:
- @baxcloud/baxstream — docs — video conversion + AI
- @baxcloud/baxmail — docs — transactional email
- @baxcloud/baxverify — docs — SMS OTP verification
- @baxcloud/baxlinks — docs — deep linking & attribution
Install
npm install @baxcloud/parse-server-baxmail parse-serverRequires Node.js 18+. Enable BaxMail and verify a sending domain in the BaxCloud dashboard first.
Quick start
1. Environment
BAXCLOUD_PROJECT_ID=your-project-id
BAXCLOUD_API_KEY=your-api-key2. Parse Server config
const { ParseServer } = require('parse-server');
new ParseServer({
databaseURI: process.env.DATABASE_URI,
appId: process.env.PARSE_APP_ID,
masterKey: process.env.PARSE_MASTER_KEY,
serverURL: process.env.PARSE_SERVER_URL,
appName: 'My App',
verifyUserEmails: true,
emailVerifyTokenValidityDuration: 2 * 60 * 60,
emailAdapter: {
module: '@baxcloud/parse-server-baxmail',
options: {
sendingDomain: 'yourdomain.com',
fromName: 'My App',
},
},
});Credentials can live in env vars (BAXCLOUD_PROJECT_ID, BAXCLOUD_API_KEY) or in emailAdapter.options.
3. Password reset
Parse Server sends reset emails automatically when users call requestPasswordReset. No extra client setup.
Configuration options
Pass these in emailAdapter.options:
| Option | Description |
|--------|-------------|
| projectId | BaxCloud project ID (or BAXCLOUD_PROJECT_ID) |
| apiKey | BaxCloud API key with BaxMail enabled (or BAXCLOUD_API_KEY) |
| from | Override sender address on a verified domain |
| fromName | Sender display name (defaults to Parse appName for auth emails) |
| sendingDomain | Verified domain — uses project default local-part (e.g. [email protected]) |
| verificationSubject | Custom verification email subject |
| passwordResetSubject | Custom password reset subject |
| timeout | BaxMail request timeout in ms (default 30000) |
| debug | Log BaxMail requests to console |
Custom factory
For a local adapter file or shared defaults:
const { createBaxMailParseEmailAdapter } = require('@baxcloud/parse-server-baxmail/create');
module.exports = createBaxMailParseEmailAdapter({
projectId: process.env.BAXCLOUD_PROJECT_ID,
apiKey: process.env.BAXCLOUD_API_KEY,
sendingDomain: 'yourdomain.com',
});Then point Parse Server at your file:
emailAdapter: {
module: './adapters/baxmail-email.js',
},MailAdapter methods
Implements the Parse Server MailAdapter contract:
| Method | Used for |
|--------|----------|
| sendMail({ to, subject, text, html?, from? }) | Generic mail (required) |
| sendVerificationEmail({ appName, link, user }) | Email verification |
| sendPasswordResetEmail({ appName, link, user }) | Password reset |
When sendVerificationEmail / sendPasswordResetEmail are implemented, Parse Server uses them instead of building plain-text defaults.
How it works
- Parse Server triggers verification or password reset (or your code calls the adapter).
- This adapter formats the message and calls BaxMail via
@baxcloud/baxmail. - BaxMail sends from your verified domain with DKIM signing and logs delivery.
Set Sender display name in Dashboard → BaxMail → Setup for the project default, or pass fromName in adapter options.
Error codes
BaxMail API failures return stable codes such as BAXMAIL_DOMAIN_NOT_VERIFIED or BAXMAIL_SENDER_NOT_CONFIGURED, often with details.helpUrl pointing to the dashboard fix.
See BaxMail error codes.
Related SDKs
- @baxcloud/baxcloud-server-sdk — docs — webhooks, rooms, streaming, PK Battle
- @baxcloud/baxstream — docs — video conversion + AI
- @baxcloud/baxmail — docs — BaxMail Node.js SDK
- @baxcloud/baxverify — docs — SMS OTP verification
- @baxcloud/baxlinks — docs — deep linking & attribution
License
MIT
Support
- Help: https://baxcloud.tech/dashboard/help
- Contact: https://baxcloud.tech/contact
- Documentation: https://baxcloud.tech/docs/baxmail/sdk/parse-server
- Email: [email protected]
