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
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.
FastAPI
FastAPI
Create a FastAPI route to handle the embed requests and generate JWT tokens.You’ll also need to upload your public signing key to the HumanLayer dashboard.
Django
Django
Create a Django view to handle the embed requests and generate JWT tokens.
Express
Express
Create an Express route handler to handle the embed requests and generate JWT tokens.