All documentation
SDK

Framework Recipes: Express, Next.js, React, Django, FastAPI and Flask

Use the two official SDKs cleanly across common JavaScript and Python frameworks without creating a separate SDK for every framework.

Multi-language

Overview

Framework support is intentionally layered on the official JavaScript and Python SDKs. JavaScript server frameworks use pulsegrid. Frontend frameworks use pulsegrid/client. Python web frameworks use the Python pulsegrid package. This keeps behavior consistent and prevents documentation from duplicating the same API for every framework.

Setup

Express / Node backend: Create one server-side PulseGrid client and reuse it in routes/services. Next.js: Use pulsegrid only in server routes, server actions or other server-only modules. Use pulsegrid/client in client components with a token fetched from your server. React / Vue / Angular / Vite: Use pulsegrid/client only. Obtain short-lived tokens from your backend. Django / FastAPI / Flask: Create PulseGrid from environment variables inside trusted server code. Use it in views/routes/services/tasks. React Native / Expo: Use the client-token approach. Do not place the project secret in the distributed app.

Code example

Framework Recipes: Express, Next.js, React, Django, FastAPI and Flask
Express / Next.js server route
import { createPulseGrid } from "pulsegrid";
const pg = createPulseGrid();

Notes

Do not call a framework an official standalone PulseGrid SDK unless a dedicated package actually exists. Today the official language packages are JavaScript/TypeScript and Python. Frameworks listed here are integration environments using those packages.