Showing the first 18000 characters. Load the complete file to read the remainder.
# Convex Documentation
> For general information about Convex, read [https://www.convex.dev/llms.txt](https://www.convex.dev/llms.txt).
## understanding
- [Best Practices](/understanding/best-practices.md): Essential best practices for building scalable Convex applications including database queries, function organization, validation, and security.
- [TypeScript](/understanding/best-practices/typescript.md): Move faster with end-to-end type safety
- [Convex Overview](/understanding/overview.md): Introduction to Convex - the reactive database with TypeScript queries
- [Dev workflow](/understanding/workflow.md): Development workflow from project creation to production deployment
- [The Zen of Convex](/understanding/zen.md): Convex best practices and design philosophy
## quickstart
- [Android Kotlin Quickstart](/quickstart/android.md): Add Convex to an Android Kotlin project
- [Using Convex with Bun](/quickstart/bun.md): Add Convex to a Bun project
- [Next.js Quickstart](/quickstart/nextjs.md): Add Convex to a Next.js project
- [Node.js Quickstart](/quickstart/nodejs.md): Add Convex to a Node.js project
- [Nuxt Quickstart](/quickstart/nuxt.md): Add Convex to a Nuxt project
- [Quickstarts](/quickstart/overview.md): Get started quickly with your favorite frontend framework or language
- [Python Quickstart](/quickstart/python.md): Add Convex to a Python project
- [React Quickstart](/quickstart/react.md): Add Convex to a React project
- [React Native Quickstart](/quickstart/react-native.md): Add Convex to a React Native Expo project
- [Remix Quickstart](/quickstart/remix.md): Add Convex to a Remix project
- [Rust Quickstart](/quickstart/rust.md): Add Convex to a Rust project
- [Script Tag Quickstart](/quickstart/script-tag.md): Add Convex to any website
- [Svelte Quickstart](/quickstart/svelte.md): Add Convex to a Svelte project
- [iOS Swift Quickstart](/quickstart/swift.md): Add Convex to an iOS Swift project
- [TanStack Start Quickstart](/quickstart/tanstack-start.md): Add Convex to a TanStack Start project
- [Vue Quickstart](/quickstart/vue.md): Add Convex to a Vue project
## functions
- [Actions](/functions/actions.md): Call third-party services and external APIs from Convex
- [Bundling](/functions/bundling.md): How Convex bundles and optimizes your function code
- [Debugging](/functions/debugging.md): Debug Convex functions during development and production
- [Error Handling](/functions/error-handling.md): Handle errors in Convex queries, mutations, and actions
- [Application Errors](/functions/error-handling/application-errors.md): Handle expected failures in Convex functions
- [HTTP Actions](/functions/http-actions.md): Build HTTP APIs directly in Convex
- [Internal Functions](/functions/internal-functions.md): Functions that can only be called by other Convex functions
- [Mutations](/functions/mutation-functions.md): Insert, update, and remove data from the database
- [Functions](/functions/overview.md): Write functions to define your server behavior
- [Queries](/functions/query-functions.md): Fetch data from the database with caching and reactivity
- [Runtimes](/functions/runtimes.md): Learn the differences between the Convex and Node.js runtimes for functions
- [Argument and Return Value Validation](/functions/validation.md): Validate function arguments and return values for security
## database
- [Commit Timestamp](/database/advanced/commit-timestamp.md): Efficient iteration using a strictly increasing sequence identifier.
- [OCC and Atomicity](/database/advanced/occ.md): Optimistic concurrency control and transaction atomicity in Convex
- [Schema Philosophy](/database/advanced/schema-philosophy.md): Convex schema design philosophy and best practices
- [System Tables](/database/advanced/system-tables.md): Access metadata for Convex built-in features through system tables including scheduled functions and file storage information.
- [Backups](/database/backup-restore.md): Backup and restore your Convex data and files
- [Document IDs](/database/document-ids.md): Create complex, relational data models using IDs
- [Data Import & Export](/database/import-export.md): Import data from existing sources and export data to external systems
- [Data Export](/database/import-export/export.md): Export your data out of Convex
- [Data Import](/database/import-export/import.md): Import data into Convex
- [Database](/database/overview.md): Store JSON-like documents with a relational data model
- [Paginated Queries](/database/pagination.md): Load paginated queries
- [Reading Data](/database/reading-data.md): Query and read data from Convex database tables
- [Filtering](/database/reading-data/filters.md): Filter documents in Convex queries
- [Indexes](/database/reading-data/indexes.md): Speed up queries with database indexes
- [Introduction to Indexes and Query Performance](/database/reading-data/indexes/indexes-and-query-perf.md): Learn the effects of indexes on query performance
- [Schemas](/database/schemas.md): Schema validation keeps your Convex data neat and tidy. It also gives you end-to-end TypeScript type safety!
- [Data Types](/database/types.md): Supported data types in Convex documents
- [Writing Data](/database/writing-data.md): Insert, update, and delete data in Convex database tables
## realtime
- [Realtime](/realtime.md): Building realtime apps with Convex
## auth
- [Custom OIDC Provider](/auth/advanced/custom-auth.md): Integrate Convex with any OpenID Connect identity provider using custom authentication configuration and ConvexProviderWithAuth.
- [Custom JWT Provider](/auth/advanced/custom-jwt.md): Configure Convex to work with custom JWT providers that don't implement full OIDC protocol, including setup and client-side integration.
- [Convex & Auth0](/auth/auth0.md): Integrate Auth0 authentication with Convex
- [Convex & WorkOS AuthKit](/auth/authkit.md): Integrate WorkOS AuthKit authentication with Convex
- [Adding WorkOS AuthKit to an Existing App](/auth/authkit/add-to-app.md): Adding WorkOS AuthKit to an existing Convex application
- [Automatic AuthKit Configuration](/auth/authkit/auto-provision.md): Configure WorkOS AuthKit integration with automatic provisioning for Convex deployments
- [AuthKit Troubleshooting](/auth/authkit/troubleshooting.md): Debugging issues with AuthKit authentication with Convex
- [Convex & Clerk](/auth/clerk.md): Integrate Clerk authentication with Convex
- [Convex Auth](/auth/convex-auth.md): Built-in authentication for Convex applications
- [Storing Users in the Convex Database](/auth/database-auth.md): Store user information in your Convex database
- [Debugging Authentication](/auth/debug.md): Troubleshoot authentication issues in Convex
- [Auth in Functions](/auth/functions-auth.md): Access user authentication in Convex functions
- [Authentication](/auth/overview.md): Add authentication to your Convex app.
## scheduling
- [Cron Jobs](/scheduling/cron-jobs.md): Schedule recurring functions in Convex
- [Scheduling](/scheduling/overview.md): Schedule functions to run once or repeatedly with scheduled functions and cron jobs
- [Scheduled Functions](/scheduling/scheduled-functions.md): Schedule functions to run in the future
## file-storage
- [Deleting Files](/file-storage/delete-files.md): Delete files stored in Convex
- [Accessing File Metadata](/file-storage/file-metadata.md): Access file metadata stored in Convex
- [File Storage](/file-storage/overview.md): Store and serve files of any type
- [Serving Files](/file-storage/serve-files.md): Serve files stored in Convex to users
- [Storing Generated Files](/file-storage/store-files.md): Store files generated in Convex actions
- [Uploading and Storing Files](/file-storage/upload-files.md): Upload files to Convex storage
## search
- [AI & Search](/search/overview.md): Run search queries over your Convex documents
- [Full Text Search](/search/text-search.md): Run search queries over your Convex documents
- [Vector Search](/search/vector-search.md): Run vector search queries on embeddings
## components
- [Authoring Components](/components/authoring.md): Creating new components
- [Components](/components/overview.md): Self contained building blocks of your app
- [Understanding Components](/components/understanding.md): Understanding components
- [Using Components](/components/using.md): Using existing components
## ai
- [Convex Agent Skills](/ai/agent-skills.md): Install Convex Agent Skills to give your AI coding agent specialized Convex workflows
- [Convex MCP Server](/ai/convex-mcp-server.md): Convex MCP server
- [Convex Agent Plugins](/ai/convex-plugins.md): What the official Convex plugins for coding agents do, how to install them for Claude Code, Codex, and Cursor, how to use them effectively, and how to give feedback.
- [AI Code Generation](/ai/overview.md): How to use AI code generation effectively with Convex
- [Using Claude Code with Convex](/ai/using-claude-code.md): Build and scale apps with Claude Code and Convex, and get the full power of Convex out of the official Claude Code plugin: MCP tools, hooks, and skills.
- [Using Codex with Convex](/ai/using-codex.md): Build and scale apps with OpenAI Codex and Convex, and get the full power of Convex out of the official Codex plugin: subagents, MCP tools, and skills.
- [Using Conductor with Convex](/ai/using-conductor.md): Tips and best practices for using Conductor with Convex
- [Using Cursor with Convex](/ai/using-cursor.md): Build and scale apps with Cursor and Convex, and get the full power of Convex out of the official Cursor plugin: MCP tools, hooks, and skills.
- [Using GitHub Copilot with Convex](/ai/using-github-copilot.md): Tips and best practices for using GitHub Copilot with Convex
## ai-gateway
- [HTTP API](/ai-gateway/api.md): Request and response shapes for the AI Gateway HTTP API
- [Images and videos](/ai-gateway/images-and-videos.md): Generate images and videos from Convex actions with the AI Gateway
- [Models](/ai-gateway/models.md): Which models the AI Gateway serves and how to name them
- [AI Gateway](/ai-gateway/overview.md): Managed AI model access from Convex actions
- [Getting started](/ai-gateway/setup.md): Call the AI Gateway from a Convex action with the OpenAI SDK, the Agent component, the Vercel AI SDK, or fetch
- [Usage and Billing](/ai-gateway/usage-and-billing.md): See what your AI Gateway requests cost and how Convex bills them
- [Voice](/ai-gateway/voice.md): Transcribe audio and generate speech from Convex actions
## agents
- [Agent Definition and Usage](/agents/agent-usage.md): Configuring and using the Agent class
- [LLM Context](/agents/context.md): Customizing the context provided to the Agent's LLM
- [Debugging](/agents/debugging.md): Debugging the Agent component
- [Files and Images in Agent messages](/agents/files.md): Working with images and files in the Agent component
- [Getting Started with Agent](/agents/getting-started.md): Setting up the agent component
- [Human Agents](/agents/human-agents.md): Saving messages from a human as an agent
- [Messages](/agents/messages.md): Sending and receiving messages with an agent
- [AI Agents](/agents/overview.md): Building AI Agents with Convex
- [Playground](/agents/playground.md): A simple way to test, debug, and develop with the agent
- [RAG (Retrieval-Augmented Generation) with the Agent component](/agents/rag.md): Examples of how to use RAG with the Convex Agent component
- [Rate Limiting](/agents/rate-limiting.md): Control the rate of requests to your AI agent
- [Streaming](/agents/streaming.md): Streaming messages with an agent
- [Threads](/agents/threads.md): Group messages together in a conversation history
- [Tool Approval](/agents/tool-approval.md): Human-in-the-loop tool approval for the Agent component
- [Tools](/agents/tools.md): Using tool calls with the Agent component
- [Usage Tracking](/agents/usage-tracking.md): Tracking token usage of the Agent component
- [Workflows](/agents/workflows.md): Defining long-lived workflows for the Agent component
## testing
- [Continuous Integration](/testing/ci.md): Set up continuous integration testing for Convex applications
- [Testing Local Backend](/testing/convex-backend.md): Test functions using the local open-source Convex backend
- [convex-test](/testing/convex-test.md): Mock Convex backend for fast automated testing of functions
- [Testing](/testing/overview.md): Testing your backend
## linting
- [Biome](/linting/biome.md): Use the Convex lint rules alongside Biome
- [ESLint](/linting/eslint.md): Set up the Convex lint rules with ESLint
- [Linting](/linting/overview.md): Lint rules that catch common mistakes in Convex code
- [Oxlint](/linting/oxlint.md): Use the Convex lint rules with Oxlint
## production
- [Abuse Protection](/production/abuse-protection.md): What Convex deployments are protected from by default, including DDoS attacks, and how to add your own Cloudflare or Vercel edge for more control
- [Contact Us](/production/contact.md): Get support, provide feedback, stay updated with Convex releases, and report security vulnerabilities through our community channels.
- [Custom Domains](/production/custom-domains.md): Set up a custom domain for your Convex cloud deployment
- [Environment Variables](/production/environment-variables.md): Declare, store, and access environment variables in Convex
- [Deploy Your Frontend](/production/hosting.md): Deploy your Convex backend alongside your frontend hosting
- [Custom Hosting](/production/hosting/custom.md): Host your frontend on any static hosting provider, such as GitHub Pages.
- [Using Convex with Netlify](/production/hosting/netlify.md): Host your frontend on Netlify and your backend on Convex
- [Using Convex with Vercel](/production/hosting/vercel.md): Host your frontend on Vercel and your backend on Convex
- [Integrations](/production/integrations.md): Integrate Convex with third party services
- [Audit Logging](/production/integrations/audit-logging.md): Add transactional audit logging to your Convex functions
- [Exception Reporting](/production/integrations/exception-reporting.md): Configure exception reporting integrations for your Convex deployment
- [Log Streams](/production/integrations/log-streams.md): Configure logging integrations for your Convex deployment
- [(Legacy) Event schema](/production/integrations/log-streams/legacy-event-schema.md): Log streams configured before May 23, 2024 will use the legacy format
- [Streaming Data in and out of Convex](/production/integrations/streaming-import-export.md): Streaming Data in and out of Convex
- [Working with Multiple Deployments](/production/multiple-deployments.md): Creating multiple deployments in a single project
- [Multiple Repositories](/production/multiple-repos.md): Use Convex in multiple repositories
- [Networking](/production/networking.md): IP addresses used by Convex for outbound requests
- [Deploying Your App to Production](/production/overview.md): Tips for building safe and reliable production apps
- [Pausing a Deployment](/production/pause-deployment.md): Temporarily disable a deployment without deleting data
- [Regions](/production/regions.md): Learn how to select a region for your Convex deployments
- [Status and Guarantees](/production/state.md): Learn about Convex's production guarantees, availability targets, data durability, security features, and upcoming platform enhancements.
- [Limits](/production/state/limits.md): We’d love for you to have unlimited joy building on Convex but engineering
- [Usage Limits](/production/usage-limits.md): Cap how much a deployment can consume per day or month
## self-hosting
- [Self Hosting](/self-hosting.md): Self Hosting Convex Projects
## cli
- [Agent Mode](/cli/agent-mode.md): Configure agentic development for cloud-based and local deployments
- [Deploy Keys](/cli/deploy-key-types.md): Use deploy keys for authentication in production build environments
- [Local Deployments for Development](/cli/local-deployments.md): Develop with Convex using deployments running locally on your machine
- [CLI](/cli/overview.md): Command-line interface for managing Convex projects and functions
- [npx convex ai-files](/cli/reference/ai-files.md): Manage Convex AI files
- [npx convex codegen](/cli/reference/codegen.md): Generate backend type definitions
- [npx convex dashboard](/cli/reference/dashboard.md): Open the dashboard in the browser
- [npx convex data](/cli/reference/data.md): List tables and print data from your database
- [npx convex deploy](/cli/reference/deploy.md): Deploy to a production or preview deployment
- [npx convex deployment](/cli/reference/deployment.md): Manage deployments
- [npx convex dev](/cli/reference/dev.md): Develop against a dev deployment, watching for changes
- [npx convex docs](/cli/reference/docs.md): Open the docs in the browser
- [npx convex env](/cli/reference/env.md): Set and view environment variables
- [npx convex export](/cli/reference/export.md): Export data from your deployment to a ZIP file
- [npx convex function-spec](/cli/reference/function-spec.md): List function metadata from your deployment
- [npx convex import](/cli/reference/import.md): Import data from a file to your deployment
- [npx convex insights](/cli/reference/insights.md): Show health insights for your deployment
- [npx convex logout](/cli/reference/logout.md): Log out of Convex on this machine
- [npx convex logs](/cli/reference/logs.md): Watch logs from your deployment
- [npx convex mcp](/cli/reference/mcp.md): Manage the Model Context Protocol server for Convex [BETA]
- [npx convex project](/cli/reference/project.md): Manage projects
- [npx convex run](/cli/reference/run.md): Run a function or evaluate an inline readonly query on your deployment
- [npx convex update](/cli/reference/update.md): Print instructions for updating the convex package
- [Typecheck Performance](/cli/troubleshooting/typecheck-performance.md): Debug slow typechecking performance when pushing code
## cli
Measured from the saved file
Linked document
UTF-8 text size
45.5 KB46625 bytes
Token count
10637o200k_base encoding
Markdown links
410410 distinct URLs
Fenced code blocks
0512 lines in the file
Size measures the captured UTF-8 text, not compressed transfer size. Tokens are counted with a named tokenizer; other models can count differently. Neither measure establishes context compatibility or answer quality.
Project H1
Convex Documentation
Opening blockquote
For general information about Convex, read [https://www.convex.dev/llms.txt](https://www.convex.dev/llms.txt).
Context architecture
How the content is divided
33 H2 sections organize 410 parsed Markdown links. 409 links point to .md or .markdown paths; 1 link occurrences use another hostname. Linked destinations have not been recursively validated.
H2 section
Links
UTF-8 bytes
Tokens
understandingLine 6
5
625
133
quickstartLine 14
16
1318
363
functionsLine 33
12
1231
265
databaseLine 48
18
1924
426
realtimeLine 69
1
65
17
authLine 73
13
1510
344
schedulingLine 89
3
308
68
file-storageLine 95
6
542
129
searchLine 104
3
263
61
componentsLine 110
4
317
66
aiLine 117
9
1361
354
ai-gatewayLine 129
7
758
193
agentsLine 139
17
1520
369
testingLine 159
4
379
87
lintingLine 166
4
305
93
productionLine 173
23
2878
630
Show 17 more sections
H2 section
Links
UTF-8 bytes
Tokens
self-hostingLine 199
1
67
18
cliLine 203
24
2267
528
clientLine 230
30
4143
961
dashboardLine 263
14
1931
395
errorLine 280
1
82
20
tutorialLine 284
3
610
121
apiLine 290
85
8613
2007
generated-apiLine 378
4
452
98
http-apiLine 385
1
77
21
chefLine 389
1
135
28
configLine 393
6
678
162
deployment-apiLine 402
24
2762
617
deployment-platform-apiLine 429
1
75
16
management-apiLine 433
50
6426
1391
platform-apisLine 486
4
538
119
public-deployment-apiLine 493
10
1193
261
team-managementLine 506
5
692
154
Nested indexes
1 distinct links point to other llms.txt paths. These are routes to more indexes, not proof their contents were included in this file.
Link counts exclude parsed fenced and inline code and resolve relative destinations against the final endpoint. Section sizes cover the text below each H2 until the next H2.
Embedded material
Code, installation and API examples
Fenced blocks
0 closed
Declared languages
No fenced blocks detected
Package-install commands
0 detected in fenced or inline code
Authentication examples
0 fenced lines match API-key, Authorization, Bearer, OAuth or access-token patterns
HTTP request examples
0 fenced lines match request-method patterns
Authentication links
5 links have authentication-related labels
Embedded example text and links to further documentation are counted separately. A code block does not establish that a sample runs or that an authentication flow succeeds.
Publisher prioritization
The Optional section
No H2 section named “Optional” was detected in this file.
The community proposal uses Optional by convention for secondary links that can be skipped for a shorter context. This label does not establish that everything outside it is critical, or that the material inside it is deprecated.
Machine-readable routes
MCP references and configuration text
MCP-related text was detected in the captured file. 2 links have MCP-related labels or paths. 0 fenced lines match mcpServers, mcp_servers or an mcp add command.
Bounded prefix inspected; the whole body was not downloaded
A verified text response establishes a companion at the checked URL. It does not prove the bundle contains all product documentation, that generation is automated, or that it fits an assistant’s context window.
Change evidence
What can be said about freshness
This capture establishes a baseline. Update frequency cannot be determined from one observation.
Linked release and migration material
1 links have release, changelog, deprecation or migration terms in their labels or paths. These provide places to investigate product changes separately.
File changes can reveal documentation edits or navigation changes. They do not by themselves measure product release velocity, accuracy, agent adoption or AI visibility.
Counts use a deterministic parser, not a spec-compliance grade. Unusual Markdown and indented code can fall outside its recognized patterns. See the llms.txt proposal and tokenizer implementation.