Add Blockchain-Based Authentication
to Any Website in Minutes
QselBase is a drop-in backend that replaces passwords and JWTs with blockchain-based authentication. Works with any framework.
What QselBase Gives You
Session Auth
Every login is verified on-chain with. Verifiable, revocable, tamper-proof. No JWTs to steal.
CRUD Data Engine
Full CRUD API backed by MongoDB. Insert, select, update, delete — with access control rules per collection.
Partner Management
Register your site, get API keys, manage users. Partner Linking NFTs create on-chain bonds with your users.
Drop-in SDK
npm install and go. Works with Next.js, React, Vue, Svelte, and plain HTML. Handles QR codes, deep links, and polling.
Zero Password Liability
No passwords stored means no passwords to breach. Session tokens live on Solana, not in your database.
Mobile-First Login
QR scan for desktop, deep link for mobile-to-mobile. Automatic device detection and flow adaptation.
Quick Start
Three steps to blockchain-based authentication on your site.
Install the SDK
npm install @qselbase/sdk axiosConfigure Environment
# .env.local NEXT_PUBLIC_QSELBASE_URL=https://your-qselbase-instance NEXT_PUBLIC_QSELBASE_API_KEY=qb_pk_your_api_key NEXT_PUBLIC_QSELBASE_PARTNER_ID=your-partner-id
Add Login Flow
// Create session → show QR → wait for approval const session = await qb.auth.createSession(); // Display session.qrCodeDataUrl as an <img> await qb.auth.waitForApproval(session.sessionId); // ✅ Authenticated! cNFT minted on Solana
SDK Reference
Full example showing authentication and data operations.
import { QselBase } from '@qselbase/sdk';
const qb = new QselBase({
projectId: 'your-partner-id',
apiKey: 'qb_pk_...',
baseUrl: 'https://your-qselbase-url',
});
// ── Authentication ──────────────────────────────
// Create a session (returns QR code data URL + deep link)
const session = await qb.auth.createSession({
eventType: 'login',
});
// Display session.qrCodeDataUrl as <img> on your login page
// User scans with QSEL Authenticator
// Wait for approval (polls automatically)
await qb.auth.waitForApproval(session.sessionId);
// ✅ User authenticated! Session stored in localStorage
const { data: { session: current } } = qb.auth.getSession();
console.log('Wallet:', current.wallet);
console.log('cNFT:', current.cNftMint);
// ── Verify session (server-side) ────────────────
const result = await qb.auth.verify();
// result.valid === true
// result.onChain === true (verified on Solana)
// ── CRUD Data Engine ────────────────────────────
const { data } = await qb
.from('users')
.select('*')
.eq('active', true);
await qb.from('posts').insert({
title: 'Hello World',
author: current.wallet,
});Auth Methods
- qb.auth.createSession(options)
- qb.auth.waitForApproval(sessionId)
- qb.auth.verify()
- qb.auth.getSession()
- qb.auth.signOut()
- qb.auth.refreshSession()
- qb.auth.getUser()
- qb.auth.updateProfile(data)
- qb.auth.linkEmail(email)
- qb.auth.onAuthStateChange(cb)
Data Methods
- qb.from(collection).select(fields)
- qb.from(collection).insert(data)
- qb.from(collection).update(data)
- qb.from(collection).delete()
- .eq(field, value)
- .neq(field, value)
- .gt(field, value)
- .lt(field, value)
- .order(field, dir)
- .limit(count)
Start Building Today
Get your API key, install the SDK, and have NFT authentication running on your site in under 10 minutes.