Next.js
Install the Angstroma widget in a Next.js application using the built-in Script component. Works with App Router (v13+) and Pages Router.
Coming soon
A dedicated Next.js npm package is on the roadmap. The
next/script approach below works today in every Next.js app. If you prefer a React component wrapper, use @angstroma/a11y-sdk in a client component.App Router (Next.js 13+)
Add the widget to your root layout at app/layout.tsx. It loads on every page automatically.
Note
Use
strategy="afterInteractive" — this loads the widget after the page becomes interactive. Do not use strategy="beforeInteractive", which would block page rendering.Pages Router
Add to pages/_app.tsx:
Using an environment variable
Store the API key in your environment rather than hardcoding it. Add to .env.local:
Then use it in the layout:
Note
The API key is public by design — it is embedded in your page HTML. It identifies your tenant but does not grant write access to your account. Treat it like a public analytics ID, not a password.
With the npm SDK (optional)
If you need programmatic control (enabling features from code, loading user profiles, using AI features), use the JavaScript SDK instead of the script tag.