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-server

Your 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-key

Parse 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

  1. Flutter sends OTP and verifies with BaxVerify (baxcloud_verify_sdk).
  2. Client calls ParseUser.logInWith('baxverify', result.externalAuth) externalAuth is { id: phone, token: accessToken }.
  3. Parse Server runs validateAuthData and validates the JWT via BaxVerify.
  4. On success, Parse stores phone on the user and returns a Parse session token.

Flutter Parse login guide →

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