Start with your website’s installation instructions
In Protection, select Browse integrations. The directory opens with the Protection filter selected. Choose your runtime and select Open protection setup. If the connection already appears in Protection, use its settings directly. Download the kit and use the example for your registered HTTPS origin, public site key and API origin. A workspace owner can generate the private site credential in Site credential.
- Store ORAAMI_API_TOKEN and the cookie-signing secret ORAAMI_COOKIE_SECRET in your server secret manager. Use the same cookie secret on all replicas serving this hostname. Only the public tracker snippet belongs in the browser.
- Mount middleware before shared caches, body parsers and application handlers. In Next.js App Router, wrap each protected HTTP export. Preserve the registered public Host, original request path and trusted HTTPS scheme.
- For challenge policies, configure the hostname’s Turnstile site key and secret in server-only configuration. In Settings → Installation, include Protection session linking and deploy the updated tracker.
Node.js and NestJS with Express
Node.js 22 or later runs the middleware in process. Use createManagedProtectionMiddleware from managed/node.mjs in the downloaded kit. Install it before Express routes or wrap the root Node HTTP handler using the example in the Node.js / Express setup.
For NestJS with Express, choose the NestJS adapter in the integration directory, set the runtime to nestjs and register the middleware with app.use before the application initializes or listens. These instructions target the Express HTTP adapter.
Next.js App Router on the Node runtime
Open the Next.js App Router setup from the protection integration directory and extract its route handler kit beside the app directory. The dashboard supplies the API origin, registered site origin and public site key. Set the site credential and shared cookie secret in the server environment. Use Node 22 or later.
Create app/.well-known/oraami/[endpoint]/route.js using the dashboard snippet. In each protected route.js file, use the Node runtime, keep the route dynamic and wrap the existing HTTP export with protectRoute. The handler receives the original request body and route parameters. Cover each public path or rewrite that reaches the operation.
Deploy and select Verify installation. The dashboard policy starts paused. Enable the action for your wrapped methods and confirm the reported revision. For submission limits, call the same-origin session bootstrap or enable protection session linking before the first submission. Check a denial against its receipt in Request activity.
export const runtime = 'nodejs';
export const dynamic = 'force-dynamic';
export const POST = protectRoute(submitOrder);Set up the local bridge for the other five runtimes
Run the supplied Node.js 22 or later bridge alongside each serving application instance in the same network namespace. The wrapper calls the bridge on 127.0.0.1:8765. Keep its listener on loopback and supervise both processes. The bridge holds the Oraami API credential, cookie secret and any Turnstile secrets.
Give the wrapper and the bridge the same separate random ORAAMI_BRIDGE_TOKEN of at least 32 characters. Configure ORAAMI_API_ORIGIN, ORAAMI_PUBLIC_ORIGIN and ORAAMI_SITE_KEY from the website’s installation instructions. Set ORAAMI_POLICY_SOURCE=dashboard and ORAAMI_MIDDLEWARE_RUNTIME to the value for your adapter.
node bridges/bridge.mjsPython ASGI with FastAPI or Starlette
Use Python 3.9 or later. Add bridges/python to the import path and wrap the root ASGI application with OraamiProtection, passing the bridge token. Set the bridge runtime to python_asgi. Your ASGI server must expose the raw path and trusted HTTPS scheme. Route WebSocket endpoints separately if your application uses them.
Go net/http
Use Go 1.23 or later. Reference the kit’s Go package with a local go.mod replace directive. Create the adapter using the bridge token and wrap the root http.Handler before passing it to your HTTP server. Set the bridge runtime to go_http.
Ruby on Rails and Rack
Use Ruby 3.1 or later with Rack 3. Add the bundled Ruby adapter to the application. In Rails, insert OraamiProtection::Middleware at position zero in the middleware stack. In a Rack application, wrap the root app. Preserve REQUEST_URI and set the bridge runtime to ruby_rack.
PHP PSR-15
Use PHP 8.1 or later with cURL and the PSR dependencies listed in the kit. Supply PSR-17 response and stream factories and put the PSR-15 adapter at the outside of your middleware stack. Preserve the original request target at the PHP entry point and emit the adapter’s PSR-7 response. Set the bridge runtime to php.
C with Libevent evhttp
Use C11 and Libevent 2.1 evhttp. Compile the C adapter from the kit, call oraami_evhttp_protect before application routing and use the provided reply helpers to preserve response and cookie headers. Set the bridge runtime to c_http.
Apply dashboard changes to the deployed adapter
- Deploy the opted-in adapter for this site. Keep the actual application and its status endpoint reachable on the registered HTTPS hostname.
- In the server connection settings, open Dashboard policy, select Manage this server policy from the dashboard and save the reviewed action and routes. You can save with enforcement paused while connecting.
- Select Verify installation. When you are ready, turn on Enable server enforcement, save and verify the reported policy revision. The same site policy applies to every opted-in server runtime.
Manage credentials and local policy files
Site credential shows the current issue date, first recorded creation, last authenticated check and retained history. The owner can generate, rotate or revoke the credential shared by the site’s server adapters. Copy a new credential when shown and save it in the secret manager. Rotation immediately invalidates the prior value. Update every serving instance, restart and verify.
A locally configured Node.js deployment uses createProtectionMiddleware with local options. A bridge can use ORAAMI_POLICY_SOURCE=local and ORAAMI_POLICY for its local configuration. File-based policies change through application deployment. Turning off dashboard management pauses an opted-in adapter.
Common questions
Do I need a separate site credential for every language?
One server credential belongs to the registered website and serves its server integrations. Rotate it across every instance that uses it. The managed Cloudflare connection has its own setup.
Does Node.js need the local bridge?
Node.js and NestJS with Express use middleware directly. Next.js App Router wraps the selected route handlers in the Node process. The Python, Go, Ruby, PHP and C adapters use a colocated bridge.