
How to
In your Custom Data settings you specify the endpoint that returns the JSON data of your components. This handler also takes care of fetching and parsing data to be represented. You can also provide headers optionally when creating a Custom Data.
- Create the function that serves the request under e.g.
pages/api/sidebar/section.ts
.
- Integrate data sources and fetch all data you want e.g. Stripe, Prisma, etc.
Request Body
The request body contains:-
threadId:
string
-
email:
string
Back on the Thread View you will find a new section with the title and the data you are displaying.
Components
We provide you with a set of components including text and button to help you build your custom data integration. Each component needs to be included in a row which is separated by a left and right section for proper vertical and horizontal layout. Choose the attributes you want to apply and add them into a JSON response from your endpoint.Row
Type | Attributes |
---|---|
Row | right , left |
Text
Type | Attributes |
---|---|
Text | color , size , text |
Badge
Type | Attributes |
---|---|
Badge | color , text |
Spacer
Type | Attributes |
---|---|
Spacer | size |
LinkButton
Type | Attributes |
---|---|
LinkButton | size , label , url |
CopyButton
Type | Attributes |
---|---|
CopyButton | value , tooltip |