FlowBond Layer 0 · Identity API

One identity for
every app you build.

FlowBond ID (FBID) is the Layer 0 identity protocol behind the whole network. Add Connect with FlowBond to your app and your users arrive already known — one login, one profile, moving freely across every world in the ecosystem.

~5 min
to first login
1 line
to add the button
19+
apps on the network
Zero-knowledge
by default

whyBuilt for your stack

FBID drops into anything — Next.js, plain HTML, mobile webviews, server-side. It speaks standard OAuth 2.0 + PKCE, so if you've shipped "Sign in with Google," you already know the shape.

🔑

One-tap Connect

A drop-in button. Users authenticate at the FBID hub and return with a verified identity and session.

🧬

Portable profiles

Display name, handle, avatar and verified status travel with the user across every connected app.

🛡️

Zero-knowledge core

Guarded by ClaudIA. The server recovers zero plaintext of a user's private vault — you get identity, never their secrets.

Supabase-native

Map FBID straight onto your own rows. Works seamlessly with Supabase Auth + RLS in your project.

01Quickstart

From zero to a working login in three steps.

Create an app & get keys

Register your app in the developer console to get an appId and secret, and add your redirect URIs. (Grab sandbox keys instantly below in Developer tools.)

Install the SDK

terminal
npm install @flowbond/auth

Add Connect with FlowBond

app.js
import { FlowBond } from '@flowbond/auth'

const fb = new FlowBond({
  appId: 'app_live_xxx',
  redirectUri: 'https://yourapp.com/callback',
})

// open the FlowBond hub and return a verified user
const user = await fb.connect()

console.log(user.fbid, user.handle) // → "fb_a1b2…", "@steph"

That's it. The user lands back in your app authenticated, with a session you can read anywhere.

02The Connect button

This is the entire user experience. Click it to preview the handoff your users will feel — open the hub, approve, return identified.

Steph Ferrera
@steph · fb_a1b2c3
✓ verified
A simulated FBID handoff — no real auth.

What happens under the hood

  • Open — SDK opens fbid.flowbond.life/authorize with PKCE.
  • Approve — the user signs in once and approves your app's scopes.
  • Return — they're redirected back with a code you exchange for a session.
  • Known — you receive a verified fbid, handle, name & avatar.

Returning users with an active FlowBond session skip straight to approve — often a single tap.

03Install & setup

Pick your environment. The SDK ships ESM, a React adapter, and a zero-dependency browser script.

npm
React
Browser / CDN
terminal
npm install @flowbond/auth
# or: pnpm add @flowbond/auth · yarn add @flowbond/auth
_app.tsx
import { FlowBondProvider } from '@flowbond/auth/react'

export default function App({ Component, pageProps }) {
  return (
    <FlowBondProvider appId="app_live_xxx">
      <Component {...pageProps} />
    </FlowBondProvider>
  )
}
index.html
<script type="module">
  import { FlowBond } from 'https://cdn.flowbond.app/auth/v1/flowbond.js'
  const fb = new FlowBond({ appId: 'app_live_xxx' })
</script>

04SDK reference

The full surface of @flowbond/auth. Same identity primitives in vanilla JS and React.

JavaScript
React hooks
flowbond.js
const fb = new FlowBond({ appId, redirectUri, scopes: ['identity', 'profile'] })

await fb.connect()            // open hub → returns User
await fb.getUser()            // current user or null
const t = await fb.getToken()    // access token for your API calls
fb.onAuthChange(user => {})   // subscribe to session changes
await fb.signOut()            // clear local session

// the User object you get back
{
  fbid: 'fb_a1b2c3',         // canonical, stable identity id
  handle: '@steph',
  displayName: 'Steph Ferrera',
  avatar: 'https://…',
  verified: true
}
Profile.tsx
import { useFlowBond, ConnectButton } from '@flowbond/auth/react'

function Profile() {
  const { user, loading, signOut } = useFlowBond()

  if (loading) return <Spinner/>
  if (!user) return <ConnectButton/>       // the drop-in button

  return <div>gm, {user.handle} <button onClick={signOut}>leave</button></div>
}

05REST API

Prefer to drive it yourself? Every SDK call maps to a documented endpoint. Base URL https://api.flowbond.app/v1.

Authorization flow (OAuth 2.0 + PKCE)

GEThttps://fbid.flowbond.life/authorizestart · redirect user here
POST/auth/tokenexchange code → access token
POST/auth/refreshrefresh an expired token

Identity

GET/identity/methe authenticated user
GET/identity/:fbida public profile
POST/identity/verifyverify a token server-side

Example — exchange & fetch the user

cURL
Node
terminal
curl https://api.flowbond.app/v1/identity/me \
  -H "Authorization: Bearer $ACCESS_TOKEN"

# → { "fbid": "fb_a1b2c3", "handle": "@steph", "verified": true }
server.ts
const res = await fetch('https://api.flowbond.app/v1/identity/me', {
  headers: { Authorization: `Bearer ${token}` }
})
const user = await res.json()
🔒
Treat your app secret like a password — server-side only. The browser flow uses PKCE, so no secret is ever exposed to the client.

06Identity model

The mental model is small on purpose. There is one canonical id, and you map it onto your own data.

  • FBID — a stable, canonical identity id (fb_…). One human, one FBID, forever. Use it as the foreign key in your tables.
  • Profile — the portable, user-owned layer: handle, display name, avatar, verified status. Shared across the network.
  • Session — a short-lived access token (+ refresh) scoped to your app and the scopes the user approved.
  • Scopesidentity (the fbid) and profile (name/handle/avatar) today; more granular scopes are opt-in.
your-schema.sql
-- map FlowBond identity straight onto your rows
create table posts (
  id      uuid primary key default gen_random_uuid(),
  fbid    text not null,   -- ← FlowBond ID
  body    text,
  created timestamptz default now()
);
🛡️
Zero-knowledge promise. ClaudIA guards the user's private vault with client-side crypto — the FlowBond server recovers zero plaintext. As an integrator you receive verified identity, never a user's private data.

07Developer tools

Everything you need to build and debug. Spin up sandbox keys right here to try the flow before you register a production app.

🎛️

Console

Create apps, manage redirect URIs, rotate keys, and watch live auth events.

🧪

Sandbox

A full FBID environment with test identities — no real users touched.

📡

Webhooks

Subscribe to user.connected and profile.updated events.

📖

Explorer

An interactive API explorer to fire requests with your sandbox token.

Generate sandbox keys

sandbox
# Click “Generate keys” to mint a throwaway sandbox app id + secret.

08Go to production

The short checklist before you flip to live keys.

  • Swap app_test_… for your app_live_… id and set live redirect URIs.
  • Keep the app secret server-side only; never ship it to the browser.
  • Verify tokens server-side with /identity/verify before trusting a session.
  • Store fbid as your user key and enforce it in Supabase RLS policies.
  • Handle onAuthChange so the UI reacts when a session ends or refreshes.