Overview
Add your Invent AI assistant to any Remix application. Perfect for full-stack React applications with nested routing and progressive enhancement.Installation
1
Create Assistant Component
2
Add to Root
3
Configure Environment
Add to
.env:User Authentication
Server-Side Hash Generation
Use Remix loaders for secure hash generation:Using Resource Routes
Create a resource route for dynamic user data:Integration with Remix Auth
Nested Routes with Context
Pass route-specific context:TypeScript Support
Add type declarations:Using with Sessions
Tips for Remix
Server Loaders
Use loaders for secure hash generation
Progressive Enhancement
Works without JavaScript enabled
Nested Routes
Integrate with nested routing
Type Safety
Full TypeScript support
Troubleshooting
Script loading multiple times
Script loading multiple times
Solutions:
- Add check if script already exists
- Use proper cleanup in useEffect
- Ensure component only renders once
- Check for duplicate components in tree
Hydration mismatches
Hydration mismatches
Solutions:
- Ensure data is available on both server and client
- Check that loader data is serializable
- Verify useEffect cleanup
- Test with JavaScript disabled
Environment variables not working
Environment variables not working
Solutions:
- Restart dev server after adding variables
- Don’t prefix server-only variables
- Never expose secret key to client
- Check loader returns correct data
Best Practices
- Always use loaders for server-side operations
- Keep secret keys server-side only
- Leverage Remix’s built-in session management
- Use resource routes for dynamic data
- Test with progressive enhancement in mind