BigBlocks Docs

Getting Started

Quick setup guide for BigBlocks components

Getting Started

Get up and running with BigBlocks in minutes.

Installation

Using npm/yarn/bun

# npm
npm install bigblocks@latest

# yarn
yarn add bigblocks@latest

# bun
bun add bigblocks@latest

Using init-prism

For a complete project setup with BigBlocks pre-configured:

npm install -g init-prism@latest
init-prism create my-app --bigblocks

Basic Setup

1. Add Required Providers

Wrap your application with the necessary providers:

import { 
  BitcoinAuthProvider, 
  BitcoinQueryProvider,
  BitcoinThemeProvider 
} from 'bigblocks';

function App() {
  return (
    <BitcoinAuthProvider config={{ apiUrl: '/api' }}>
      <BitcoinQueryProvider>
        <BitcoinThemeProvider defaultTheme="orange">
          {/* Your app content */}
        </BitcoinThemeProvider>
      </BitcoinQueryProvider>
    </BitcoinAuthProvider>
  );
}

2. Add Your First Component

Import and use any BigBlocks component:

import { AuthButton, ProfileCard } from 'bigblocks';

function MyComponent() {
  return (
    <div>
      <AuthButton />
      <ProfileCard profile={userProfile} />
    </div>
  );
}

3. Framework-Specific Setup

Next.js (App Router)

// app/api/auth/[...nextauth]/route.ts
import { createNextJSBigBlocks } from 'bigblocks/nextjs';

const { auth, handlers } = createNextJSBigBlocks({
  // Your config
});

export { handlers.GET, handlers.POST };

Express

import { createExpressBigBlocks } from 'bigblocks/express';

const bigblocks = createExpressBigBlocks({
  // Your config
});

app.use('/auth', bigblocks.router);

Astro

import { createAstroBigBlocks } from 'bigblocks/astro';

const bigblocks = createAstroBigBlocks({
  // Your config
});

Core Concepts

Bitcoin as Identity

In BigBlocks, Bitcoin private keys ARE the user's identity:

  • No traditional usernames or passwords
  • Client-side key generation only
  • BSM (Bitcoin Signed Messages) for authentication
  • Encrypted backup storage via OAuth providers

Required Providers

Most BigBlocks components require these context providers:

  1. BitcoinAuthProvider - Manages authentication state
  2. BitcoinQueryProvider - Handles data fetching
  3. BitcoinThemeProvider - Provides theme context

Component Categories

BigBlocks components are organized into categories:

  • Authentication - Login, signup, OAuth flows
  • Profiles - Identity and profile management
  • Wallet - Bitcoin transactions and balances
  • Social - Posts, likes, follows
  • Market - Trading and marketplace
  • MetaLens - Universal commenting system
  • UI Primitives - Basic building blocks

Next Steps