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:
- Node.js 18.0+ or Deno 1.35+ or Bun 1.0+
- npm, yarn, pnpm, or bun package manager
- Modern browser or CLI environment
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:
npm install @divisions/core @divisions/adapter-node
yarn add @divisions/core @divisions/adapter-node
pnpm add @divisions/core @divisions/adapter-node
bun add @divisions/core @divisions/adapter-node
Basic Setup
Initialize a new #divisions project in your workspace:
npx create-division-app my-project cd my-project npm run dev
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:
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:
DIVISIONS_APP_ID=proj_xxxxxxxxx DIVISIONS_SECRET=sk_live_xxxxxxxxx DATABASE_URL=postgresql://localhost:5432/mydb
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:
- Read the Quick Start Guide to build your first module
- Explore Authentication for user management
- Check out API Reference for endpoint details