{"id":51317913,"url":"https://github.com/vllnt/convex-helpers","last_synced_at":"2026-07-01T09:31:17.911Z","repository":{"id":365114532,"uuid":"1190865677","full_name":"vllnt/convex-helpers","owner":"vllnt","description":"Typed host-side helpers for Convex backends — builders, errors, validators, relationships, pagination, HTTP, env, and observability.","archived":false,"fork":false,"pushed_at":"2026-06-15T22:50:22.000Z","size":159,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-16T00:21:05.358Z","etag":null,"topics":["backend","convex","convex-helpers","open-source","typescript","vllnt"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@vllnt/convex-helpers","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vllnt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":{"github":"bntvllnt"}},"created_at":"2026-03-24T17:37:06.000Z","updated_at":"2026-06-15T22:32:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/vllnt/convex-helpers","commit_stats":null,"previous_names":["vllnt/convex-helpers"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/vllnt/convex-helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vllnt%2Fconvex-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vllnt%2Fconvex-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vllnt%2Fconvex-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vllnt%2Fconvex-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vllnt","download_url":"https://codeload.github.com/vllnt/convex-helpers/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vllnt%2Fconvex-helpers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35001648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","convex","convex-helpers","open-source","typescript","vllnt"],"created_at":"2026-07-01T09:31:16.583Z","updated_at":"2026-07-01T09:31:17.903Z","avatar_url":"https://github.com/vllnt.png","language":"TypeScript","funding_links":["https://github.com/sponsors/bntvllnt"],"categories":[],"sub_categories":[],"readme":"\u003c!-- Badges --\u003e\n[![npm version](https://img.shields.io/npm/v/@vllnt/convex-helpers.svg)](https://www.npmjs.com/package/@vllnt/convex-helpers)\n[![CI](https://github.com/vllnt/convex-helpers/actions/workflows/ci.yml/badge.svg)](https://github.com/vllnt/convex-helpers/actions/workflows/ci.yml)\n[![License: MIT](https://img.shields.io/npm/l/@vllnt/convex-helpers.svg)](./LICENSE)\n\n# @vllnt/convex-helpers\n\nTyped host-side helpers for Convex backends — builders, errors, validators, relationships,\npagination, HTTP, env, and observability.\n\n```ts\nimport { asyncMap, pruneNull, nullThrows } from \"@vllnt/convex-helpers\";\n\nconst docs = pruneNull(await asyncMap(ids, (id) =\u003e ctx.db.get(id)));\nconst doc = nullThrows(await ctx.db.get(id), `Document ${id} not found`);\n```\n\nA helpers library (not a sandboxed Convex component): pure functions and host-`ctx` glue that run with\nthe host's `ctx` — no own tables, no `app.use()` mounting. Stateful concerns (rate limiting,\nidempotency, flags) belong in `@convex-dev/*` or `@vllnt/convex-*` components.\n\nSee [ROADMAP.md](./ROADMAP.md) for the planned module surface.\n\n## Features\n\n- `asyncMap` — parallel async map that preserves order\n- `pruneNull` — filter null/undefined from arrays\n- `nullThrows` — non-null assertion with typed `NullDocumentError`\n- `./mcp` — expose Convex functions as MCP tools (`createMCPServer` + `query`/`mutation`/`action`/`resource`), default-deny auth, optional cursor pagination\n- [planned] `./builders` — `customQuery`/`customMutation`/`customAction`/`customCtx`\n- [planned] `./errors` — typed `AppError` + HTTP-status map\n- [planned] `./auth` — provider-agnostic `requireIdentity`/`getCurrentSubject`\n- [planned] `./env` — `defineEnv(zodSchema)` cold-start validation\n- [planned] `./tracing` — span emit + `traceparent` propagation via `@vllnt/logger`\n- [planned] `./testing` — fixture factories + `withIdentity`\n- [planned] `./relationships`, `./validators`, `./pagination`, `./rls`, `./triggers`, `./http`\n- [planned] `./react` — optional tree-shakeable front-end hooks layer\n\n## Installation\n\n```bash\npnpm add @vllnt/convex-helpers\n```\n\n`convex` is a peer dependency:\n\n```bash\npnpm add convex\n```\n\n## Usage\n\n```ts\nimport { asyncMap, pruneNull, nullThrows } from \"@vllnt/convex-helpers\";\n\n// Parallel fetch with null filtering\nconst docs = pruneNull(await asyncMap(ids, (id) =\u003e ctx.db.get(id)));\n\n// Non-null assertion\nconst doc = nullThrows(await ctx.db.get(id), `Document ${id} not found`);\n```\n\n### MCP tools — `./mcp`\n\nExpose Convex functions to LLM agents over the Model Context Protocol. The `./mcp` entry is\ntree-shakeable — backend-only consumers pull zero MCP code. It needs two optional peer deps:\n\n```bash\npnpm add @modelcontextprotocol/sdk zod\n```\n\n```ts\nimport { createMCPServer, query, mutation } from \"@vllnt/convex-helpers/mcp\";\nimport { api } from \"./_generated/api\";\nimport { v } from \"convex/values\";\n\nexport const mcp = createMCPServer({\n  auth: { validate: async (key) =\u003e key === process.env.MCP_API_KEY },\n  tools: {\n    list_projects: query(api.projects.list, { args: v.object({}), description: \"List all projects\" }),\n    create_project: mutation(api.projects.create, {\n      args: v.object({ name: v.string() }),\n      description: \"Create a project\",\n    }),\n  },\n});\n\n// Mount the route handler (e.g. Next.js App Router)\nexport const { GET, POST } = mcp.handler();\n```\n\nMigrating from `@vllnt/convex-mcp`? Change the import to `@vllnt/convex-helpers/mcp` — the API is\nidentical. See [docs/API.md](./docs/API.md#mcp-tools-mcp) for the full `./mcp` reference.\n\n## API Reference\n\nSee [docs/API.md](./docs/API.md) for full API reference with signatures and examples.\n\n## Testing\n\n```bash\npnpm test\npnpm test:coverage   # must reach 100%\n```\n\nTests use [vitest](https://vitest.dev) with the node environment. 100% coverage is enforced via\n`vitest.config.mts` thresholds.\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for development setup, code style, and PR guidelines.\n\n## Author\n\nBuilt by [bntvllnt](https://github.com/bntvllnt) · [bntvllnt.com](https://bntvllnt.com) · [X\n@bntvllnt](https://x.com/bntvllnt)\n\nPart of the [@vllnt](https://github.com/vllnt) Convex component fleet —\n[vllnt.com](https://vllnt.com)\n\nIf this is useful, [sponsor the work](https://github.com/sponsors/bntvllnt).\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvllnt%2Fconvex-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvllnt%2Fconvex-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvllnt%2Fconvex-helpers/lists"}