Chainbox

The Cognitive Bridge

"Stop building plumbing. Start building the bridge between your interface and your intelligence."

1. Install

Add the package

2. Define

Write pure functions

3. Execute

Call from anywhere

The Post-API Reality:

"What if your browser already knew every backend capability existed? No endpoints to find. No documentation to hunt. Just an immediate, signed, and secure connection to your most powerful logic."

Phase 1: Zero Setup

Terminal
npm install @sddion/chainbox

Phase 2: Defining Intuition

Run the initialization command to generate your config file:

npx chainbox init

Environment Variables (Dynamic)

Chainbox intelligently scans your environment (loading .env automatically). It looks for standard keys like SUPABASE_URL or keys ending in _URL.

Phase 3: Choose your Database

Chainbox supports both Supabase and Firebase out of the box. You can choose your provider in chainbox.config.ts:

export default Config({
  database: "firebase" // or "supabase" (default)
});

For more details on setting up credentials, see the Database Adapters guide.

Framework Integrations

Vite (React/Vue)

import { defineConfig } from "vite";
import { ChainboxVite } from "@sddion/chainbox/vite";

export default defineConfig({
  plugins: [ChainboxVite()]
});

Next.js App Router

// app/api/chain/route.ts
import { ChainboxRoute } from "@sddion/chainbox/next";
export const { POST } = ChainboxRoute();

Production Serving

Deploy your frontend and backend as a single unit using the standalone server. This is perfect for the **Zero-Config CDN** approach.

npx chainbox serve --port 4000 --static dist

Pro-tip: Combine this with Attribute-Driven Calls to build sites with zero JavaScript boilerplate.

Developer Tools

Use the CLI to inspect your capabilities registry.

npx chainbox list