Use Croche.open(...) to open a project for your app’s user. Pass the project’s key, configuration, and registered tool handlers. See the TypeScript or React Native option tables.
Get an agent
Section titled “Get an agent”After opening a project as croche:
const agent = await croche.agent();const result = await agent.request({ id: crypto.randomUUID(), text: 'Hello!',});Use the agent API for named agents and separate conversations. Each agent has its own conversation and memory.
Keep users separate
Section titled “Keep users separate”Use the authenticated user’s stable ID for the user option. Do not trust an unauthenticated client to choose another user’s identity. In a backend app, keep each user’s storage separate.
Close when finished
Section titled “Close when finished”await croche.close();Close the project when its lifetime in your app ends. For a complete example with cleanup, see the TypeScript guide.