Displaying Specific Apps in the Knit UI Component
The Knit UI component allows you to customize which apps are displayed by using the Auth Session Creation API. This guide walks you through the process of filtering apps so that only the desired ones appear in the UI.
Passing Filters in the API Request
To display only a specific app (or apps) in the UI, use the filters
parameter in your API request. Here's an example:
cURL Example
curl --request POST \
--url https://api.getknit.dev/v1.0/auth.createSession \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"originOrgId": "client1",
"originOrgName": "Client 1",
"originUserEmail": "[email protected]",
"originUserName": "User 1",
"filters": [
{
"apps": [
"darwinbox"
],
"category": "HRIS"
}
]
}
'
In this example:
apps
: Lists the app(s) you want to display ("darwinbox"
in this case).category
: Specifies the category of the app (e.g.,"HRIS"
for Human Resource Information Systems).
Behavior in the Knit UI
When you apply this filter:
- The UI component will display only the app(s) specified in the
filters
section. - Example: If you include
"darwinbox"
in the filter, the UI will only show Darwinbox.
Visual Example
You can watch a demonstration of this behavior here.
Customizing the Filter
To display multiple apps, simply include them in the apps
array. For example:
"filters": [
{
"apps": [
"darwinbox",
"workday"
],
"category": "HRIS"
}
]
Get List of Supported Apps
The Get List of Supported Apps API allows you to programmatically retrieve the list of apps supported by Knit, along with their IDs. This can be useful for dynamically fetching app details to use in your flows.
The response will include a list of apps with their names, IDs, and other metadata. You can use these app IDs in the filters
parameter when configuring the UI component.
Updated 1 day ago