1. Add the kit in test mode
Run the initializer in the root of your application.npx openlegion init my-app and then cd my-app. When the browser opens, approve the code displayed in your terminal. The CLI installs @openlegion/platform, writes a test key to .env.local and adds these files to the application.
2. Start both development processes
Start the Next.js server with the command the initializer printed. For an npm project, use the development script..env.local. If the CLI asks you to restart your application, restart the app server, then run the CLI command again.
3. Verify the round trip
Openhttp://localhost:3000/agent on the default development port and ask What’s my account? Look for get_account in the CLI output and the example customer information in the chat. That confirms the agent called code in your application.
If the page opens but calls redirect to your login page, check whether your app’s sign-in middleware covers /api/openlegion. Let the kit handle that route’s signed requests and keep the browser session check in your server-side resolver. Before putting real customer data behind the example tool, replace the development session with your own authentication. Identity and tools
Maintained quickstart and scaffold examples · Setup with a coding agent