Confect is organized into five core packages, each serving a specific purpose in the development lifecycle. This modular design allows you to use only what you need and understand the boundaries between different parts of the framework.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rjdellecese/confect/llms.txt
Use this file to discover all available pages before exploring further.
Package Overview
@confect/core
Shared specs and schemas used by all packages
@confect/server
Backend bindings to the Convex platform
@confect/react
Client-side bindings for React applications
@confect/cli
Developer tooling for codegen and sync
@confect/test
Testing utilities for Confect applications
@confect/core
Description: Shared specs and schemas used by all Confect packages When to use: Always required. This is the foundation package that defines the spec/impl model and schema types.Key Exports
FunctionSpec- Define function specifications (queries, mutations, actions)GroupSpec- Organize functions into logical groupsSpec- Top-level specification containerGenericId- Type-safe document IDsSystemFields- Convex system fields (_id, _creationTime)UserIdentity- User authentication typesRefs- Type-safe function references
Dependencies
package.json
@confect/core has no production dependencies - only peer dependencies on
convex and effect.@confect/server
Description: Backend bindings to the Convex platform When to use: Required for implementing Convex functions (queries, mutations, actions) with Confect.Key Exports
Impl- Implementation layer that connects specs to handlersFunctionImpl- Individual function implementationsGroupImpl- Group-level implementationsDatabaseReader- Effect service for reading from the databaseDatabaseWriter- Effect service for writing to the databaseDatabaseSchema- Define database schemas with Effect schemasTable- Table definitions with schema validationAuth- Authentication serviceStorage- File storage servicesScheduler- Schedule functions for later executionHandler- Function handler typesRegisteredFunctions- Export Convex-compatible functions
Dependencies
package.json
@confect/react
Description: Client-side bindings for React applications When to use: Required for React applications that need to call Confect functions.Key Features
- Type-safe hooks generated from your specs
- Automatic encoding/decoding of Effect schemas
- Seamless integration with Convex’s React client
Dependencies
package.json
@confect/react supports both React 18 and React 19.
@confect/cli
Description: Developer tooling for codegen and sync When to use: Required during development to generate type-safe APIs and sync your specs.Key Features
- Automatic code generation from specs
- Generates type-safe function references
- Generates Effect services for database access
- Syncs specs with implementations
- Watches for changes during development
Usage
Generated Files
The CLI generates files inconfect/_generated/:
api.ts- Type-safe API object for Convex functionsrefs.ts- Type-safe function referencesservices.ts- Effect service types (DatabaseReader, DatabaseWriter)registeredFunctions.ts- Registry of all functions
Dependencies
package.json
@confect/test
Description: Utilities for testing Confect applications without a live Convex backend When to use: Use in your test files to test Confect functions in isolation.Key Features
- Mock Convex backend for testing
- Test functions without deploying to Convex
- Fast unit tests for business logic
Dependencies
package.json
Installing Packages
In a typical Confect project, yourpackage.json will include:
package.json
Next Steps
Project Structure
Learn how to organize your Confect project
Spec-Impl Model
Understand the separation between specs and implementations