Note: For the complete demo application, see the Next.js example.
Why use Moss with Next.js?
Server Actions provide a clean boundary between client and server code. Moss runs server-side to keep credentials secure, while the client gets fast, relevant search results without managing API infrastructure or exposing keys.Required tools
Integration guide
Environment setup
Create a
.env.local file in your project root with your Moss credentials..env.local
Create a Server Action
Create a Server Action that initializes the Moss client, loads the index, and runs queries.
app/actions.ts