Installation
Quick reference for all supported frameworks. For step-by-step instructions, use the Quick start guide and pick your framework at the top.
| Framework | Package | Provider | Auto page views |
|---|---|---|---|
| Next.js App Router | npm install nohmo | NohmoNextProvider in app/layout.tsx | ✓ automatic |
| Next.js Pages Router | npm install nohmo | NohmoProvider in pages/_app.tsx | usePageView() per route |
| React (Vite / CRA) | npm install nohmo | NohmoProvider in App.tsx | usePageView() per route |
| Plain HTML / Django | <script> tag only | None needed | ✓ automatic |
| React Native / Expo | npm install nohmo | NohmoProvider from nohmo/react-native | Babel plugin or useScreenView() |
| Node backend | npm install nohmo | init() from nohmo/server | n/a — errors only |
| Python backend | pip install nohmo | Middleware from nohmo_sdk | n/a — errors only |
npm package
The React providers need React 17 or later; React is an optional peer dependency, so the script tag and the Node server SDK work without it. Install once — every entry point ships in the same package.
bash
npm install nohmo
Environment variables
Get your project ID and API key from Dashboard → Settings → API Keys.
env
# Next.js (.env.local)NEXT_PUBLIC_NOHMO_PROJECT_ID=proj_xxxxNEXT_PUBLIC_NOHMO_API_KEY=pk_xxxx# Vite (.env)VITE_NOHMO_PROJECT_ID=proj_xxxxVITE_NOHMO_API_KEY=pk_xxxx# CRA (.env)REACT_APP_NOHMO_PROJECT_ID=proj_xxxxREACT_APP_NOHMO_API_KEY=pk_xxxx
Browser script (CDN)
For plain HTML, Django, Rails, or any server-rendered project — no npm required.
html
<scriptsrc="https://cdn.jsdelivr.net/npm/nohmo@latest/dist/n.min.js"data-project="proj_xxxx"data-api-key="pk_xxxx"defer></script>