Framework Quick Start
Overview
The bkend REST API works the same regardless of framework. Here we cover setup for the two most popular options: Next.js and Flutter.
Prerequisites
Publishable Key
Console > API Keys
Next.js
1. Set Environment Variables
Create a .env.local file in your project root.
NEXT_PUBLIC_BKEND_API_URL=https://api-client.bkend.ai
NEXT_PUBLIC_BKEND_PUBLISHABLE_KEY={pk_publishable_key}⚠️ Environment variables prefixed with NEXT_PUBLIC_ are exposed to the client. Never put a Secret Key (sk_) in a NEXT_PUBLIC_ variable. Use only Publishable Key (pk_).
2. Create a Fetch Helper
3. Fetch Data Example
Flutter
1. Environment Setup
Create a config file in the lib/config/ directory.
2. HTTP Client Setup
Use the dio package.
3. Fetch Data Example
✅ Your framework setup is complete. For more detailed integration patterns, see Integrating bkend in Your App.
Next Steps
Integrating bkend in Your App — Fetch helper, token refresh, error handling
Token Storage and Refresh — Access Token auto-refresh strategies
Auth Form Patterns — Signup and login form implementation
Hands-on Project Cookbook — Build real apps for each framework
Last updated