Getting Started
Add Components & Tools
Learn how to add and register new components with Hydra AI
This guide will walk you through the process of adding and registering new components with Hydra AI.
First, create your React component as you normally would:
💡 Recommended: Use Zod for Type Definitions
While this example uses JSON Schema, we recommend using Zod for better type safety and validation.
Check out our Using Zod guide to learn more.
Add your new component to your hydra-config.ts
file:
When adding components that need to fetch data, you can include context tools:
🔒 Type Safety Tip
Using Zod can help ensure type safety for your context tools' return values.
More information on Zod context tools can be found in our next guide.
- Type Definitions:
- Consider using Zod for better type safety
- Keep prop definitions clear and well-documented
- Use TypeScript
Now you're ready to create and register components with Hydra AI! Remember to test your components thoroughly before deploying them to production.