> ## Documentation Index
> Fetch the complete documentation index at: https://docs.threetone.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Next.js preparation

> Separate server-side workspace API access from browser interaction when preparing a Next.js agent experience.

A Next.js integration has two boundaries: your server reads or manages workspace resources, while a browser displays the experience. Giving the browser a workspace API key would collapse those boundaries.

<Note>Server-side resource reads can use the public API today. A live browser conversation needs a released session-initiation and client transport path; it is not established by this guide.</Note>

## Prepare the application

<Steps>
  <Step title="Keep credentials on the server">Store `THREETONE_API_KEY` in a server environment variable. Never give it a `NEXT_PUBLIC_` prefix or pass it through client component props. Keep the module that reads it server-only.</Step>
  <Step title="Authorize your own users">Before a server action or route reads private workspace data, verify the caller's identity and resource access. Hiding an agent ID in the interface is not authorization.</Step>
  <Step title="Read only the required data">Use [Get agent](/api-reference/agents-platform/get-agent) or [List agents](/api-reference/agents-platform/list-agents). Validate the response and return only fields needed by the interface. Avoid sharing private configuration through a public cache.</Step>
  <Step title="Prepare browser behavior">Provide loading, failure, and unavailable states. For a future voice experience, request microphone access only after a deliberate user action and include keyboard-accessible stop and mute controls.</Step>
</Steps>

Use the [TypeScript REST example](/agents-platform/resources/sdks/typescript) for authenticated resource reads. Review the [web deployment checklist](/agents-platform/deploy/web/overview) before adding a live experience.

## Frequently asked questions

<AccordionGroup>
  <Accordion title="Does Threetone provide an installable Next.js SDK?" id="faq-nextjs-sdk">No first-party installable SDK is verified in this documentation release. The example uses server-side HTTP requests, not an invented package.</Accordion>
  <Accordion title="Should the browser call my server for every agent operation?" id="faq-nextjs-boundary">Route privileged workspace operations through an authorized server boundary. A future supported session transport may connect independently with appropriately scoped session access.</Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.