Component structure
A component is defined by theComponentDefinition interface:
Creating a component
Publishing a registry
Registry format
The registry supports two formats:Remote format (recommended)
Legacy format
Authentication
For private registries, set an environment variable:Best practices
- Keep components focused - One component per responsibility
- Document props - Use TypeScript interfaces and JSDoc comments
- Minimize dependencies - Fewer npm packages = easier installation
- Use registry dependencies - Reuse common utilities like
use-video-frame - Test thoroughly - Install components in a real project before publishing
- Version carefully - Consider semantic versioning for breaking changes
Example registry structure
Timeout and fallback
The registry client has a 5-second timeout. If fetching fails:- The CLI falls back to the local built-in registry
- Users see a warning but can still use default components