Getting Started
Project Structure
Understand the recommended project layout when integrating Interna into your application.
Recommended Layout
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 protectionKey Files
| File | Purpose |
|---|---|
lib/interna.ts | Singleton SDK client instance |
lib/auth.ts | Session management and token refresh |
middleware.ts | Route-level authentication guards |
api/webhooks/route.ts | Webhook 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_...