Contact Channels
React Embed
Embed approval flows in your React applications
This feature is currently in alpha, and the design of it is rapidly evolving. Contact us at contact@humanlayer.dev to get early access.
Overview
The React embed channel allows you to embed HumanLayer approval flows directly in your React applications. This enables:
- Custom approval UIs that match your application’s design
- In-app approval workflows
- Real-time updates using websockets
- Integration with your existing authentication system
Installation
Backend Setup
In general you will need to implement two routes:
- Auth - Generate a JWT token containing user/tenant info, usually
/api/humanlayer-auth
- Embed - Handle the embed requests, usually
/api/humanlayer-embed
The specific location of your backend routes can be configured in the HumanLayerProvider
component in Frontend Setup.
For HumanLayer to verify the JWT token, you need to use the same signing key that you configured in the HumanLayer dashboard.
Frontend Setup
Components
React Hooks
The React embed package also provides hooks for fetching data: