Sidebar sections
Connect your database or other 3rd party libraries with Productlane.
Sidebar sections help you display custom data for each company or person in each thread. Display things like their pricing tier, usage, an impersonation button, activation milestones and more to enable an excellent and fast support experience for your customers.
How to
In your Sidebar Sections 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 Sidebar Section.
The specified endpoint can handle complex data and integrate multiple data sources. In the end it is important that it returns your customized components structure. The following shows an example using NextJS.
- 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 |
Example
Text
Type | Attributes |
---|---|
Text | color , size , text |
Example
Badge
Type | Attributes |
---|---|
Badge | color , text |
Example
Spacer
Type | Attributes |
---|---|
Spacer | size |
Example
LinkButton
Type | Attributes |
---|---|
LinkButton | size , label , url |
Example
Full example
One full example might look like the following. You need to return this structure from your defined webhook/endpoint in order to be rendered as Custom Sidebar Cards.