GitHub โ†—

Installation

Get #divisions up and running in your environment. Supports Node.js, Deno, and Bun out of the box.

Prerequisites

Before installing, ensure your environment meets the following requirements:

๐Ÿ’ก
Recommendation

For the best performance and tree-shaking support, we recommend using pnpm or bun install.

Install the Package

Install #divisions core and any required adapters for your runtime:

Terminal
npm install @divisions/core @divisions/adapter-node
Terminal
yarn add @divisions/core @divisions/adapter-node
Terminal
pnpm add @divisions/core @divisions/adapter-node
Terminal
bun add @divisions/core @divisions/adapter-node

Basic Setup

Initialize a new #divisions project in your workspace:

Terminal
npx create-division-app my-project
cd my-project
npm run dev
โœ…
Success

Your development server will start at http://localhost:3000. Open your browser to verify the setup.

Configuration File

After installation, create a divisions.config.ts in your project root:

divisions.config.ts
import { defineConfig } from '@divisions/core';

export default defineConfig({
  appId: process.env.DIVISIONS_APP_ID,
  secret: process.env.DIVISIONS_SECRET,
  runtime: 'node',
  features: [
    'analytics',
    'auth',
    'cache'
  ]
});

Environment Variables

Create a .env.local file to securely store your credentials:

.env.local
DIVISIONS_APP_ID=proj_xxxxxxxxx
DIVISIONS_SECRET=sk_live_xxxxxxxxx
DATABASE_URL=postgresql://localhost:5432/mydb
โš ๏ธ
Security Notice

Never commit .env files to version control. Add them to your .gitignore immediately.

Next Steps

You're ready to start building! Here are the recommended paths:

  1. Read the Quick Start Guide to build your first module
  2. Explore Authentication for user management
  3. Check out API Reference for endpoint details