DocumentationInstallation

Installation

Quick reference for all supported frameworks. For step-by-step instructions, use the Quick start guide and pick your framework at the top.

FrameworkPackageProviderAuto page views
Next.js App Routernpm install nohmoNohmoNextProvider in app/layout.tsx✓ automatic
Next.js Pages Routernpm install nohmoNohmoProvider in pages/_app.tsxusePageView() per route
React (Vite / CRA)npm install nohmoNohmoProvider in App.tsxusePageView() per route
Plain HTML / Django<script> tag onlyNone needed✓ automatic
React Native / Exponpm install nohmoNohmoProvider from nohmo/react-nativeBabel plugin or useScreenView()
Node backendnpm install nohmoinit() from nohmo/servern/a — errors only
Python backendpip install nohmoMiddleware from nohmo_sdkn/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_xxxx
NEXT_PUBLIC_NOHMO_API_KEY=pk_xxxx
# Vite (.env)
VITE_NOHMO_PROJECT_ID=proj_xxxx
VITE_NOHMO_API_KEY=pk_xxxx
# CRA (.env)
REACT_APP_NOHMO_PROJECT_ID=proj_xxxx
REACT_APP_NOHMO_API_KEY=pk_xxxx

Browser script (CDN)

For plain HTML, Django, Rails, or any server-rendered project — no npm required.

html
<script
src="https://cdn.jsdelivr.net/npm/nohmo@latest/dist/n.min.js"
data-project="proj_xxxx"
data-api-key="pk_xxxx"
defer
></script>