White Label Integration

This guide explains how to create and manage BlueNexus accounts programmatically on behalf of your existing users — a key step for enabling white-label integrations.

If you already have users authenticated in your own system (via email/password, SSO, or a social provider), you can use the BlueNexus API to create and manage corresponding accounts seamlessly, without requiring your users to manually sign up with BlueNexus.

Prerequisites

Before you begin, ensure that you've completed the following steps:

  1. Registered an application and obtained your Client ID and Client Secret.

  2. Have an existing application with a user management system (your own app's users).

Creating BlueNexus Accounts

At a high level, the flow for provisioning BlueNexus accounts programmatically works as follows:

  1. Generate a cryptographic wallet that represents your user within BlueNexus.

  2. Store the wallet securely using your platform's secure storage mechanism.

  3. Create a BlueNexus account for your user by signing an authorization message.

  4. Sign a Sign-In With Ethereum (SIWE) message to prove key ownership and authenticate with BlueNexus.

  5. Send the signed authentication request to BlueNexus to obtain an access token and refresh token.

  6. Store the access and refresh tokens securely in your secure storage.

  7. Use the access token to make API requests on behalf of your user.

  8. Handle expired access tokens by refreshing them on behalf of your user.

  9. Optionally, direct users to manage their connections via a BlueNexus white-label page.

Step 1: Generate a Cryptographic Wallet for Your User

Each of your users needs a unique cryptographic wallet that identifies them within BlueNexus. This wallet allows you to sign authentication requests and securely act on their behalf.

Wallet Libraries: To generate a proper EVM-compatible wallet and sign SIWE messages, we recommend using established crypto libraries that follow blockchain best practices:

  • ethers.js - Popular, well-maintained, comprehensive Ethereum library

  • viem - Modern, type-safe alternative with better TypeScript support

  • web3.js - Widely used, especially in legacy projects

These libraries handle wallet generation, mnemonic management, and message signing securely according to blockchain standards (BIP-39, BIP-44, EIP-191, etc.).

Example using ethers.js:

Secure Storage: Use your platform's secure storage mechanism:

  • Web/Server: Encrypted database storage with proper key management

  • iOS: Keychain Services

  • Android: Keystore System

  • React Native/Expo: expo-secure-store or react-native-keychain

  • Flutter: flutter_secure_storage

Secure Random Bytes: Use your platform's cryptographically secure random number generator:

  • Web: crypto.getRandomValues()

  • Node.js: crypto.randomBytes()

  • React Native/Expo: expo-crypto.getRandomBytes() or react-native-get-random-values

  • iOS: SecRandomCopyBytes()

  • Android: SecureRandom

Step 2: Create a BlueNexus Account

Before authenticating, you must create a BlueNexus account for your user. This is done by signing an authorization message and calling the account creation endpoint.

Idempotent Endpoint: This endpoint is idempotent — if an account already exists for the given address, it will return the existing account without creating a duplicate. However, we recommend tracking which users have accounts to avoid unnecessary API calls.

Sign the authorization message:

Public Client Account Creation

For public clients without a client secret:

Confidential Client Account Creation

For confidential clients with a client secret, use Basic Authentication:

Account Creation Response:

Profile Fields: All profile fields are optional:

  • name: Display name (1-255 characters)

  • email: Valid email address

  • avatar: HTTPS URL or base64 data URI (max 2MB)

Tracking Accounts: Track in your database which user/address already has a BlueNexus account. This allows you to skip the account creation step for returning users.

Step 3: Authenticate Using SIWE (Sign-In With Ethereum)

BlueNexus uses SIWE (Sign-In With Ethereum) for authentication. This standard proves the ownership of the address/wallet by signing a message. As you are the custodian of the user's wallet (mnemonic or private key - see above), you can sign this message and authenticate on their behalf.

Client Credentials Requirements:

  • Public clients (no client secret): MUST provide client_id in the request body

  • Confidential clients (with client secret): MUST provide both client_id and client_secret using either:

See Application Typesfor more information on public v confidential clients.

Public Client Authentication

For public clients without a client secret:

Confidential Client Authentication

For confidential clients with a client secret, choose one of the following methods:

Option 1: Basic Authentication (Recommended)

Option 2: Body Parameters

What is SIWE? Sign-In With Ethereum (SIWE) is an open standard for decentralized identity and authentication. It allows users to prove ownership of their Ethereum address by signing a standardized message. Learn more at login.xyz.

Step 4: Store Access and Refresh Tokens

Once the authentication request succeeds, you'll receive a response with tokens:

Authentication Response:

Field
Description

access_token

JWT token used for API calls (short-lived)

refresh_token

JWT token used to obtain new access tokens (long-lived)

expires_in

Number of seconds until the access token expires

Store these tokens securely:

Step 5: Make API Requests on Behalf of the User

Once you have a valid access token, you can make authenticated requests to BlueNexus APIs representing that user.

Step 6: Handle expired access tokens

See Expired tokens

Manage user Connections

BlueNexus provides a white-label "Manage user Connections" application that allows you to redirect a user to easily connect and disconnect third party applications (ie: Google, Notion, Wearables data etc.) to their BlueNexus account, and hence your application.

This application can be customized to match your company branding for a seamless experience.

Learn how to integrate with the Manage Connectionsapplication.

What's Next?

Now you have established a BlueNexus account on behalf of your users, you can use the BlueNexus infrastructure within your application:

Last updated