Getting Started

Project Structure

Understand the recommended project layout when integrating Interna into your application.

Project Structure
src/
├── lib/
│   ├── interna.ts        # SDK client instance
│   └── auth.ts           # Auth helpers
├── app/
│   ├── api/
│   │   ├── users/route.ts
│   │   └── webhooks/route.ts
│   └── (auth)/
│       ├── login/page.tsx
│       └── register/page.tsx
└── middleware.ts          # Route protection

Key Files

FilePurpose
lib/interna.tsSingleton SDK client instance
lib/auth.tsSession management and token refresh
middleware.tsRoute-level authentication guards
api/webhooks/route.tsWebhook event receiver and handler

Environment Files

Store your credentials in environment files. Never commit API keys to source control.

.env.local
INTERNA_API_KEY=sk_live_...
INTERNA_WEBHOOK_SECRET=whsec_...