DevelopmentExtending
Direct Plugins
Direct Plugins
Extend Data Pod by adding code directly to the repository
When to Use
✅ Core functionality everyone needs
✅ Tight integration with Data Pod internals
✅ Open source contribution
✅ Performance critical features
❌ Proprietary logic → Use Remote Plugin
❌ Heavy AI processing → Use Remote Plugin
How It Works
Add features by modifying Data Pod packages:
- Add API endpoint → Create tRPC router
- Add data storage → Create database schema
- Add events → Define typed domain events
- Add logic → Create event handlers
The SDK auto-updates with your changes.
Step-by-Step Tutorial
1. Add a Router
Create a new tRPC endpoint:
Register it:
Done! Frontend automatically gets typed access:
2. Add Schema (Optional)
Need to store data? Add a table:
Create migration:
Export from schema:
3. Add Events (Optional)
Need event sourcing? Define typed events:
Create builder:
Publish events:
4. Add Event Handler (Optional)
Process events asynchronously:
Register handler:
Real Example: Intelligence Registry
See how Intelligence Registry implements all these patterns:
- Router:
packages/api/src/routers/intelligence-registry.ts - Schema:
packages/database/src/schema/intelligence-services.ts - Events: Not needed (simple CRUD)
Testing
Building
Type Safety
Every step is type-safe:
- ✅ Schema → TypeScript types (Drizzle ORM)
- ✅ Events → Typed domain events
- ✅ Router → tRPC types
- ✅ SDK → Auto-generated client types
Frontends get full autocomplete!
Next Steps
- Need external processing? → Hybrid Plugins
- Contributing to core? → Contributing to core
- See feed architecture in practice → Unified feed (team docs)
