Skip to Content
SPAPS is proprietary hosted SaaS. Paid access required; pre-1.0 contracts may change. Terms and access
PackagesIntegration Recipes

Integration Recipes

Use these recipes when you already know the consumer shape and need the smallest maintainable starting point.

React or Vite App

FieldValue
Auth modeBrowser publishable key with allowed origin validation
Required env varsVITE_SPAPS_API_KEY, VITE_SPAPS_API_URL or equivalent app config
First verificationnpx spaps verify --json
npm install spaps-sdk npx spaps quickstart --json npx spaps create demo-app --template react npx spaps fixtures apply --base-url http://localhost:5173 npx spaps verify --json
import { createBrowserClient } from 'spaps-sdk' export const spaps = createBrowserClient(import.meta.env.VITE_SPAPS_API_KEY, { apiUrl: import.meta.env.VITE_SPAPS_API_URL ?? 'http://localhost:3301' })

Next pages:

Next.js App

FieldValue
Auth modeBrowser publishable key for client components; secret key only in server code
Required env varsNEXT_PUBLIC_SPAPS_API_KEY, NEXT_PUBLIC_SPAPS_API_URL, SPAPS_API_KEY
First verificationnpx spaps quickstart --json then npx spaps verify --json
npm install spaps-sdk npx spaps quickstart --json npx spaps create demo-app --template nextjs npx spaps verify --json
import { createBrowserClient, createServerClient } from 'spaps-sdk' export const browserSpaps = createBrowserClient(process.env.NEXT_PUBLIC_SPAPS_API_KEY!, { apiUrl: process.env.NEXT_PUBLIC_SPAPS_API_URL }) export const serverSpaps = createServerClient(process.env.SPAPS_API_KEY!, { apiUrl: process.env.NEXT_PUBLIC_SPAPS_API_URL })

Keep createServerClient in server-only modules. Do not pass SPAPS_API_KEY into browser bundles.

Next pages:

FastAPI Consumer

FieldValue
Auth modeServer-side service settings; start with auth disabled for the smallest route proof
Required env varsSPAPS_API_URL, SPAPS_API_KEY when calling a SPAPS runtime
First verificationcurl http://127.0.0.1:8000/health
python -m venv .venv source .venv/bin/activate pip install spaps-server-quickstart
from fastapi import APIRouter from spaps_server_quickstart import create_app from spaps_server_quickstart.settings import BaseServiceSettings, create_settings_loader class Settings(BaseServiceSettings): app_name: str = "Example Consumer" spaps_auth_enabled: bool = False router = APIRouter() @router.get("/health") async def health() -> dict[str, bool]: return {"ok": True} app = create_app(settings_loader=create_settings_loader(Settings), api_router=router)
uvicorn example:app --reload curl http://127.0.0.1:8000/health

Next pages: