Track sessions and protect your routes.
Add the tracker to capture page views and clicks with your site’s consent settings. To challenge a flagged request or restrict a catalog export, link the session and enable a policy at Cloudflare or on your application server.
From click to request
Signed session linking connects a visit to its next protected request.
- Install the tracker
- Enable session linking
- Connect a Worker or Oraami Middleware
Choose hosted or local setup
For a hosted site, sign in to your Oraami workspace and copy its tracker snippet. To try capture on your own machine, use the local collector commands below.
In the platform repository, install the dependencies with Node.js 24 and build the tracker. Set the application origin before starting the local collector. It stores sessions in memory and clears them when it restarts.
npm ci
npm run build
PLATFORM_ORIGIN=http://127.0.0.1:3000 npm run start:collector:localThe local reviewer listens on port 3077 and the collector on 3079. Use the same hostname throughout because localhost and 127.0.0.1 are different origins.
Install the browser tracker
Use your app-provided integration details for a hosted site, or the loopback example below for local evaluation. Set the exact origin of the application you are observing. If your site has a Content Security Policy, allow the collector in the relevant script and connection directives.
<script
src="http://127.0.0.1:3079/staging-tracker.js"
data-collector="http://127.0.0.1:3079"
data-platform-origin="http://127.0.0.1:3000"
defer
></script>Add a visitor or account ID
Supply an explicit context record before the tracker starts. Session storage takes precedence over local storage. Unknown properties are ignored, and the adapter does not enumerate unrelated storage.
Use pseudonymous identifiers when a name or email is unnecessary. Browser context is self-reported; it must never determine membership, entitlement, or access.
sessionStorage.setItem('oraami:visitor-context', JSON.stringify({
visitorId: 'visitor-123',
accountId: 'workspace-456',
accountName: 'Example workspace'
}));Update the session at sign-in and sign-out
After the tracker signals readiness, call setContext when your application changes users or workspaces. It rotates capture so new observations are not attributed to the previous context.
On logout, remove the visitor-context records from both storage locations and call resetIdentity. Never put passwords, authentication tokens, or unrelated customer data into the context object.
// After the oraami-usage-ready event:
await window.OraamiUsage.setContext({
visitorId: 'visitor-789',
accountId: 'workspace-456'
});
// On logout:
sessionStorage.removeItem('oraami:visitor-context');
localStorage.removeItem('oraami:visitor-context');
await window.OraamiUsage.resetIdentity();Choose what the tracker can capture
The current collector is passive. Interaction summaries, browser event metadata, and replay have independent capture limits. Inspect their coverage instead of assuming that every action was recorded.
An accepted browser observation does not prove a server mutation, an authenticated identity, or malicious intent. Keep application authorization on the server.
- Only collect from origins you explicitly configure
- Validate masking and excluded surfaces before real traffic
- Treat visitor context as unverified display metadata
- Review captured evidence and collection gaps together
Install Oraami Middleware for protected routes
For an existing connection, open Protection to manage its settings. To add an adapter, select Browse integrations. The directory opens with the Protection filter selected. Choose your runtime and select Open protection setup. Oraami Middleware includes in-process adapters for Node HTTP, Express and NestJS with Express. Next.js App Router has a separate kit for wrapped HTTP handlers on the Node runtime. Python ASGI, Go net/http, Rails with Rack 3, PHP PSR-15 and C with Libevent evhttp use the local Oraami bridge.
Enable signed session linking with data-protection="true" on the existing tracker snippet. Mount the adapter before protected routes and shared caches, and keep the site credential in the server environment. Select dashboard policy management, choose routes and a response, enable enforcement and verify the revision reported by the running server. Keep your Turnstile secret on the server when using challenges.
Bridge integrations use a Node 22+ process on the same loopback network as your application. A static site can use a proxied Cloudflare hostname for edge enforcement.
Frequently asked questions
Does Oraami read all of localStorage?
No. The context adapter reads the explicit oraami:visitor-context record and an anonymous visitor identifier. It does not enumerate unrelated application storage or extract authentication tokens.
Can I use an anonymous visitor ID?
Yes. You can provide a pseudonymous visitorId. When no context is available, the adapter generates an anonymous browser identifier with an in-memory fallback if storage is unavailable.
Is the local collector durable?
The documented local collector stores evidence in memory and clears it on restart. It is an evaluation environment, not a hosted availability or durability guarantee.