Skip to main content

Next.js agent

A Next.js project with an agent route that checks a permission and a route that asks a person for approval.

StarterDraftView source
This page is a draft. The code exists, and not all of it has been run for this page yet. The page says what was checked.
Works with
JavaScript / TypeScriptNext.js

What you get​

  • Sign-in for the person who uses the agent.
  • An agent route that asks LumoAuth before it acts.
  • An approval route that sends a request to the phone of the person and waits.

Create it​

npx create-lumo-agent my-agent

The command asks for the domain, your organization and the client ID.

Settings​

VariableValue
NEXT_PUBLIC_LUMOAUTH_DOMAINhttps://app.lumoauth.dev
NEXT_PUBLIC_LUMOAUTH_ORG_IDYour organization.
NEXT_PUBLIC_LUMOAUTH_CLIENT_IDThe client ID of the application.
LUMOAUTH_AGENT_TOKENA token of the agent.

Files​

FileWhat it does
app/api/agent/route.tsA permission check before the action.
app/api/approval/route.tsAn approval request for a wire transfer.
lib/lumo.tsThe client.

Next steps​