BaxVerify/Parse Server
Parse Server SDK
Custom auth adapter for BaxVerify phone login — install on Parse Server, log in from Flutter with ParseUser.logInWith
Installation
npm install @baxcloud/parse-server-baxverify parse-serverYour BaxCloud API key must live on Parse Server only — never in mobile apps. The adapter calls BaxVerify to validate the proof JWT.
Environment
BAXCLOUD_PROJECT_ID=your-project-id
BAXCLOUD_API_KEY=your-api-keyParse 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 auth: {
9 baxverify: {
10 module: '@baxcloud/parse-server-baxverify',
11 },
12 },
13});Optional: pass credentials in auth config instead of env vars — projectId, apiKey, and consume (default true for single-use tokens).
1auth: {
2 baxverify: {
3 module: '@baxcloud/parse-server-baxverify',
4 projectId: process.env.BAXCLOUD_PROJECT_ID,
5 apiKey: process.env.BAXCLOUD_API_KEY,
6 consume: true,
7 },
8},How it works
- Flutter sends OTP and verifies with BaxVerify (
baxcloud_verify_sdk). - Client calls
ParseUser.logInWith('baxverify', result.externalAuth)—externalAuthis{ id: phone, token: accessToken }. - Parse Server runs
validateAuthDataand validates the JWT via BaxVerify. - On success, Parse stores
phoneon the user and returns a Parse session token.
Custom factory
For a local auth file or shared defaults:
1const { createBaxVerifyParseAuth } = require('@baxcloud/parse-server-baxverify/create');
2
3module.exports = createBaxVerifyParseAuth({
4 projectId: process.env.BAXCLOUD_PROJECT_ID,
5 apiKey: process.env.BAXCLOUD_API_KEY,
6});Related
Node.js SDK — BaxVerify from your own API routes
Flutter SDK — mobile OTP send & verify