OxinionDeveloper
Core

Configuration

Understand SDK configuration options and environment setup.

OxinionConfig

Pass a config object to createOxinion(). The only required field is apiKey.

typescript
1import { createOxinion } from 'oxinion';
2
3const oxinion = createOxinion({
4 apiKey: process.env.OXINION_API_KEY!,
5});

API key types

pk_...Client-side
Safe to embed in browser or mobile apps. Read access and event tracking only.
sk_...Server-side
Server or edge functions only. Required for write and admin operations. Never expose publicly.

Base URL

The SDK reads the backend URL from OXINION_BASE_URL at runtime. Set it in your .env — never commit it.

bash
1# .env.local
2OXINION_API_KEY=pk_your_public_key
3OXINION_BASE_URL=https://your-project.supabase.co/functions/v1

Next.js setup

Environment variables
Prefix with NEXT_PUBLIC_ only for client-side keys.
bash
1# .env.local
2NEXT_PUBLIC_OXINION_API_KEY=pk_... # browser-safe
3OXINION_API_KEY=sk_... # server/API routes only
4OXINION_BASE_URL=https://your-project.supabase.co/functions/v1