Framework adapters
Adapters belong in server route modules, not the Studio client bundle. They are only needed when you host the Studio yourself: they store the session cookie, exchange login codes and proxy Studio requests to the project API. Preserve the complete route and HTTP-method setup from your framework quickstart.
Next.js dependencies are NextResponse, cookies, and headers. The returned object provides GET, POST, PUT, PATCH, and DELETE handlers. Keep the Node.js runtime for the documented Next.js integration.
The adapters take no further options. Custom tools and code skills are served by createToolsHandler from @flexkit/tools on their own route; see custom tools. The handler proxies Studio’s schema fetch (GET /<projectId>/api/schema) after login, which is how Studio receives the deployed schema. The lower-level handleFlexkitRequest and its context/result types are available for adapter authors who need to perform the framework response conversion themselves.
Deployment requirements
The server handler must execute dynamically; a static-only export cannot serve authentication. Configure catch-all routing, preserve cookies and response headers, and verify deep Studio links after deployment.
Use the complete Next.js, Astro, or TanStack Start example.