Parse Server SDK
Email adapter for Parse Server — verification, password reset, and transactional mail via BaxMail
Installation
npm install @baxcloud/parse-server-baxmail parse-serverYour BaxCloud API key must live on Parse Server only — never in client apps. Enable BaxMail and verify a sending domain in the dashboard before sending.
Environment
BAXCLOUD_PROJECT_ID=your-project-id
BAXCLOUD_API_KEY=your-api-key
BAXMAIL_SENDING_DOMAIN=yourdomain.com # optional — verified sending domainParse Server config
1const { ParseServer } = require('parse-server');
2
3new ParseServer({
4 databaseURI: process.env.DATABASE_URI,
5 appId: process.env.PARSE_APP_ID,
6 masterKey: process.env.PARSE_MASTER_KEY,
7 serverURL: process.env.PARSE_SERVER_URL,
8 appName: 'My App',
9
10 verifyUserEmails: true,
11 emailVerifyTokenValidityDuration: 2 * 60 * 60,
12
13 emailAdapter: {
14 module: '@baxcloud/parse-server-baxmail',
15 options: {
16 sendingDomain: 'yourdomain.com',
17 fromName: 'My App',
18 },
19 },
20});Optional: pass credentials in emailAdapter.options instead of env vars — projectId, apiKey, from, fromName, and sendingDomain.
1emailAdapter: {
2 module: '@baxcloud/parse-server-baxmail',
3 options: {
4 projectId: process.env.BAXCLOUD_PROJECT_ID,
5 apiKey: process.env.BAXCLOUD_API_KEY,
6 sendingDomain: 'yourdomain.com',
7 fromName: 'My App',
8 },
9},MailAdapter methods
Implements the Parse Server MailAdapter contract:
sendMail— generic mail (required)sendVerificationEmail— email verification linkssendPasswordResetEmail— password reset links
When verification and reset methods are provided, Parse Server uses them instead of plain-text defaults from UserController.
How it works
- User signs up or requests password reset through Parse Server.
- Parse Server calls this adapter with the verification or reset link.
- The adapter sends via BaxMail from your verified domain.
- Delivery events appear in BaxMail logs and webhooks.
Custom factory
For a local adapter file or shared defaults:
1const { createBaxMailParseEmailAdapter } = require('@baxcloud/parse-server-baxmail/create');
2
3module.exports = createBaxMailParseEmailAdapter({
4 projectId: process.env.BAXCLOUD_PROJECT_ID,
5 apiKey: process.env.BAXCLOUD_API_KEY,
6 sendingDomain: 'yourdomain.com',
7});1emailAdapter: {
2 module: './adapters/baxmail-email.js',
3},Error codes
Failed BaxMail API calls return a structured JSON envelope. Use error.code for programmatic handling and error.details.helpUrl to link users to the right dashboard page.
{
"success": false,
"error": {
"code": "BAXVERIFY_FEATURE_DISABLED",
"message": "BaxVerify is not enabled for this project. Enable it under Project → Features.",
"details": {
"projectId": "your-project-id",
"helpUrl": "https://baxcloud.tech/dashboard/projects/your-project-id?tab=features",
"docsUrl": "https://baxcloud.tech/docs/baxverify"
}
},
"timestamp": "2026-06-06T12:00:00.000Z",
"path": "/v1/auth/sms/send"
}| Code | HTTP | Message | What to do |
|---|---|---|---|
| BAXMAIL_FEATURE_DISABLED | 403 | BaxMail is not enabled for this project. | Enable BaxMail under Project → Features (details.helpUrl). |
| BAXMAIL_PLAN_NOT_INCLUDED | 403 | Your plan does not include BaxMail. | Upgrade your subscription (details.helpUrl → Billing). |
| BAXMAIL_API_KEY_SCOPE | 403 | API key lacks BaxMail scope. | Create or edit an API key with BaxMail enabled. |
| BAXMAIL_SENDER_NOT_CONFIGURED | 400 | No sender email configured. | Verify a domain and set a default from address in BaxMail Setup (details.helpUrl). |
| BAXMAIL_DOMAIN_NOT_VERIFIED | 403 | Sending domain is not verified. | Add DNS records and verify the domain in BaxMail Setup (details.helpUrl). |
| BAXMAIL_PROVIDER_NOT_CONFIGURED | 400 | Email provider is not configured on the platform. | Contact BaxCloud support. |
| BAXMAIL_SEND_FAILED | 400 | Failed to send email. | Check domain verification, from address, and recipient. |
| BAXMAIL_RECIPIENT_SUPPRESSED | 400 | Recipient is suppressed after a hard bounce. | Do not send to this address, or remove it from the project suppression list. |
| BAXMAIL_PROJECT_INACTIVE | 403 | Project is not active. | Reactivate the project in the dashboard. |
| BAXMAIL_PROJECT_HEADER_REQUIRED | 400 | X-Project-Id header is required. | Send X-Project-Id with every request. |
| BAXMAIL_API_KEY_PROJECT_MISMATCH | 403 | API key does not belong to this project. | Use an API key created for the same project as X-Project-Id. |
1// Errors surface when Parse sends mail — check Parse Server logs
2// Common codes: BAXMAIL_DOMAIN_NOT_VERIFIED, BAXMAIL_SENDER_NOT_CONFIGUREDRelated
Node.js SDK — BaxMail from your own API routes
BaxMail docs — setup, domains, and API reference