Overview

The Synapse Edge middleware for Next.js App Router allows you to proxy inference requests entirely server-side. This injects your authentication headers at the edge, ensuring your API keys are never exposed to the client bundle.

Quickstart

Initialize the client in your `middleware.ts` file to intercept and route payloads before they hit your page components.

javascript
1
import { SynapseEdge } from '@synapse/nextjs';
2
export default SynapseEdge({apiKey: process.env.SYNAPSE_SECRET_KEY,matcher: '/api/inference/:path*'});

Installation

npm
$npm install @synapse/nextjs

DEPLOY / SYNAPSE OS

Start building with Synapse OS.

Two ways in — pick your path.

01

For humans

Get started with our Next.js and Python SDKs in seconds.

02

For agents

Tools to connect your autonomous agents to our edge infrastructure.

$npm install @synapse/sdk

Aquire $129

Aquire $129

Aquire $129

Create a free website with Framer, the website builder loved by startups, designers and agencies.