{"id":21356,"library":"fluent-convex","title":"fluent-convex","description":"A fluent API builder for Convex functions with composable middleware, reusable chains, and plugin support. Current stable version 0.13.0, actively maintained with monthly releases. Key differentiators: onion-style middleware composition, full type inference across chains, cross-function-type middleware via `$context`, and official plugins (e.g., fluent-convex/zod). Unlike raw Convex functions, provides a developer-friendly chainable syntax and middleware abstraction. Requires peer dependencies convex ^1.31.0, zod ^3.25.0 || ^4.0.0, convex-helpers >=0.1.0.","status":"active","version":"0.13.0","language":"javascript","source_language":"en","source_url":"https://github.com/mikecann/fluent-convex","tags":["javascript","convex","orpc","middleware","fluent-api","builder","plugin","typescript"],"install":[{"cmd":"npm install fluent-convex","lang":"bash","label":"npm"},{"cmd":"yarn add fluent-convex","lang":"bash","label":"yarn"},{"cmd":"pnpm add fluent-convex","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency: required for Convex backend types and runtime","package":"convex","optional":false},{"reason":"peer dependency: used by zod plugin for input validation","package":"zod","optional":true},{"reason":"peer dependency: provides helper utilities","package":"convex-helpers","optional":true}],"imports":[{"note":"ESM-only. v0.13+ uses pure ESM; CommonJS require will fail.","wrong":"const createBuilder = require('fluent-convex')","symbol":"createBuilder","correct":"import { createBuilder } from 'fluent-convex'"},{"note":"Zod plugin is a separate subpath export. Must import from 'fluent-convex/zod'.","wrong":"import { zodValidator } from 'fluent-convex'","symbol":"fluent-convex/zod","correct":"import { zodValidator } from 'fluent-convex/zod'"},{"note":"Type parameter for DataModel is required for full type inference. Omitting it loses db query types.","wrong":"import { createBuilder } from 'fluent-convex'; const b = createBuilder()","symbol":"FluconvexBuilder","correct":"import type { DataModel } from './_generated/dataModel'; import { createBuilder } from 'fluent-convex'; const b = createBuilder<DataModel>()"}],"quickstart":{"code":"import { createBuilder } from \"fluent-convex\";\nimport { v } from \"convex/values\";\nimport type { DataModel } from \"./_generated/dataModel\";\n\nconst convex = createBuilder<DataModel>();\n\nexport const listNumbers = convex\n  .query()\n  .input({ count: v.number() })\n  .handler(async (ctx, args) => {\n    const rows = await ctx.db.query(\"numbers\").order(\"desc\").take(args.count);\n    return rows.map((r) => r.value);\n  })\n  .public();","lang":"typescript","description":"Creates a Convex query using fluent-convex with input validation and public registration. Demonstrates createBuilder, .query(), .input(), .handler(), and .public()."},"warnings":[{"fix":"Use .$context<{ auth: Auth }>().createMiddleware() for cross-function-type middleware.","message":"Middleware created with .query().createMiddleware() only works on queries (not mutations/actions) because it expects QueryCtx with db property.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Check changelog for any deprecations.","message":"In v0.13, some internal APIs may change; always use the public builder methods.","severity":"deprecated","affected_versions":">=0.13.0"},{"fix":"Use import syntax (ESM) or upgrade to Node 18+ with { \"type\": \"module\" }.","message":"v0.13 requires ESM imports; CommonJS require() will throw.","severity":"breaking","affected_versions":">=0.13.0"},{"fix":"Always pass your DataModel type to createBuilder<T>()","message":"Forgetting the DataModel type parameter loses type inference on ctx.db queries.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install fluent-convex and ensure tsconfig has 'moduleResolution': 'node16' or 'bundler'","cause":"Missing types due to incorrect import path or missing tsconfig entries.","error":"Cannot find module 'fluent-convex' or its corresponding type declarations."},{"fix":"Use .$context<{ auth: Auth }>().createMiddleware() to create middleware that works across all function types.","cause":"Using query-type middleware on an action.","error":"Property 'db' does not exist on type 'ActionCtx'."},{"fix":"Import DataModel from your convex _generated folder and pass it: createBuilder<DataModel>()","cause":"Missing DataModel type parameter when calling createBuilder.","error":"Type 'DataModel' could not be inferred. Please provide explicit type argument."},{"fix":"Change to import syntax or set { \"type\": \"module\" } in package.json.","cause":"Using require() on an ESM-only package.","error":"ERR_REQUIRE_ESM"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}