AI App Template
A Next.js or Expo app with auth, a database, an agent, and a deploy
What it is
A full app scaffold for a product with users. It comes with authentication, a Postgres database, an AI agent your users can chat with, and a one-call deploy. Pick Next.js for a data-dense web app or Expo for mobile.
What it includes
How to start it
Scaffold a repo server side, create a project against it, then provision the rest. No local git or GitHub account required.
Add auth
Sign users up and in, then mint a short-lived scoped key per session instead of shipping a long-lived key.
Stream the agent to your UI
In Next.js and browsers, chatStream() yields { delta } chunks. In Expo, use chatStreamText().
Deploy
Deploys build from the linked GitHub repo.
Key SDK calls
r.github.createFromTemplate({ template, name })- scaffold the repor.projects.create({ name, repo_url })- the projectr.databases.ensure({ project_id, name })- app databaser.auth.signUp(...),r.auth.signIn(...),r.auth.createApiKey(...)- auth and scoped keysr.agents.create({ project_id, model, instructions })- the agentr.agents.chatStream(agentId, { message })/r.agents.chatStreamText(...)- stream to your UIr.projects.deploy(projectId, { branch, type })- ship it
Next steps
- Build an AI-Native App for the full walkthrough
- Connect Next.js or Connect React Native
- API Reference for every endpoint