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:
Registered an application and obtained your Client ID and Client Secret.
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:
Generate a cryptographic wallet that represents your user within BlueNexus.
Store the wallet securely using your platform's secure storage mechanism.
Create a BlueNexus account for your user by signing an authorization message.
Sign a Sign-In With Ethereum (SIWE) message to prove key ownership and authenticate with BlueNexus.
Send the signed authentication request to BlueNexus to obtain an access token and refresh token.
Store the access and refresh tokens securely in your secure storage.
Use the access token to make API requests on behalf of your user.
Handle expired access tokens by refreshing them on behalf of your user.
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.
Example using ethers.js:
Security Note: The wallet mnemonic is sensitive data that grants access to the user's BlueNexus account. Always encrypt mnemonics before storing them in your database and implement proper access controls to protect user data.
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.
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:
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.
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
Step 4: Store Access and Refresh Tokens
Once the authentication request succeeds, you'll receive a response with tokens:
Authentication Response:
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

