Setting the file. One moment.
Skill 09 · Convex Create Component
Subchapter 9.4
references/packaged-components.mdMarkdown2 KBView on GitHub
Read this file when the user wants a reusable npm package or a component shared across multiple apps.
npx create-convex@latest --component when possibleWhen building a packaged component, make sure the bundled output exists before the example app tries to consume it.
Recommended order:
npx convex codegen --component-dir ./path/to/componentnpx convex dev --typecheck-components in the example appDo not assume normal app codegen is enough for packaged component workflows.
If publishing to npm, make sure the package exposes the entry points apps need:
./convex.config.js for installing the component./_generated/component.js for the app-facing ComponentApi type./test for testing helpers when applicableconvex-test for component logic./test if consumers need easy test registration