BluxBlux

Getting Started

From zero to a working Blux integration — the whole flow in one page.

This page walks you through the full path to a working integration, from creating your app to letting users log in. Each step links to a deeper page if you want more detail.

The flow looks like this:

  1. Create an app in the Dashboard and grab your App ID.
  2. Pick a package — React or core (vanilla JS) — and install it.
  3. Initialize Blux with createConfig / BluxProvider, passing your App ID.
  4. Customize appearance, login methods, language, and wallets in the config.
  5. Use it — open the built-in modals (login, fundMe, profile) or call the data hooks/functions.

1. Create your app & get an App ID

Sign in at dashboard.blux.cc, create an app, and copy its App ID. The dashboard is also where you manage users, analytics, access rules, and which login providers are enabled.

Dashboard →

Create an app, get your App ID, and manage everything outside your code.

2. Pick a package & install

Choose based on your stack — @bluxcc/react for React/Next.js/Vite, or @bluxcc/core for any other JavaScript project.

npm install @bluxcc/react
npm install @bluxcc/core

3. Initialize Blux

Wrap your app with BluxProvider (React) or call createConfig once at startup (vanilla JS). Pass your appId so the integration is tied to your dashboard project.

import { networks, BluxProvider } from "@bluxcc/react";

<BluxProvider
  config={{
    appName: "MyApp",
    appId: "your-app-id",
    networks: [networks.mainnet],
  }}
>
  {children}
</BluxProvider>
import { createConfig, core } from "@bluxcc/core";

createConfig({
  appName: "MyApp",
  appId: "your-app-id",
  networks: [core.networks.mainnet],
});

4. Customize the config

Everything below is optional — Blux ships with sensible defaults. Add what you need to the same config object.

Enabling login methods

Add the methods you want to the loginMethods array — order determines display order:

createConfig({
  appName: "MyApp",
  appId: "your-app-id",
  loginMethods: ["wallet", "email", "passkey", "google", "meta"],
});
MethodHow to enable
WalletAdd "wallet" to loginMethods. Connects Freighter, xBull, Trezor, Ledger, and more.
EmailAdd "email" — users get a one-time code by email.
SMSAdd "sms" — users get a one-time code by phone.
PasskeyAdd "passkey" — passwordless sign-in via Face ID / Touch ID / security key.
SocialsAdd the provider key ("google", "meta", "github", "twitter", "discord", "apple") and enable that provider in the dashboard.

Social providers must be turned on for your appId in the dashboard before they appear in the modal — adding them to loginMethods alone isn't enough. See Socials.

5. Use Blux

Once initialized, you have two kinds of tools: built-in modals (full UI, no work on your side) and data hooks/functions (raw data for your own UI). In React everything is on the useBlux hook; in vanilla JS it's on the blux object.

Built-in modals

import { useBlux } from "@bluxcc/react";

function App() {
  const { login, fundMe, profile, isAuthenticated } = useBlux();
  // login()   → open the auth modal
  // fundMe()  → open the on-ramp modal
  // profile() → open the account modal
}
import { blux } from "@bluxcc/core";

blux.login();   // open the auth modal
blux.fundMe();  // open the on-ramp modal
blux.profile(); // open the account modal

Data hooks & functions

When you want to build your own UI, read chain data and call contracts directly:

That's the whole loop: configure once, then mix built-in modals with hooks/functions however your app needs. Try it all in the live demo →

On this page