Setup

Installation & Setup

Install the SDK package and configure environment variables across your client and server runtimes.

1. Install Package

# npm
npm install @chefu-tech/logix-next

# pnpm
pnpm add @chefu-tech/logix-next

# yarn
yarn add @chefu-tech/logix-next

2. Environment Variables (.env.local)

Obtain your API Key from the Logix Dashboard under API Keys and add the following secrets:

# Master API Key for Server Ingestion & Proxies
LOGIX_API_KEY="chf_a89f4129b048_..."

# Next.js Public Server Endpoint
NEXT_PUBLIC_LOGIX_SERVER_URI="https://api.chefu.co.za"

3. Singleton Initialization

// lib/logger.ts
import { createLogger } from '@chefu-tech/logix-next';

export const logger = createLogger({
  apiKey: process.env.LOGIX_API_KEY!,
  endpoint: process.env.NEXT_PUBLIC_LOGIX_SERVER_URI,
  batchSize: 10,
  flushInterval: 2000,
});