TargetDataModelList Embeddable Guide
The TargetDataModelList embeddable allows you to view all target data models of your organisation or of one sub-organisation. Like all Ingestro pipeline components, the TargetDataModelList embeddable is easy to integrate into your existing application.
This guide will help you implement the TargetDataModelList component and show how to configure it based on your specific requirements:
- Install the Ingestro package
- Get your Ingestro license key
- Get the access token
- Implement the embeddable component in your application
- Configure the component based on your specific use case
Let's get started
Step 1: Install the Ingestro package
Installing the Ingestro package is super easy.
Install with NPM:
npm install @ingestro/pipelines-react
Install with Yarn:
yarn add @ingestro/pipelines-react
Install via CDN:
https://unpkg.com/@ingestro/pipelines-vanilla-js
Step 2: Get your Ingestro license key
You can get your Ingestro license key from the Ingestro User Platform.
If you don’t have an account yet, you can sign up here.
Step 3: Get the access token
In order to authorise yourself or rather the component you have to first get the access token via our authentication API.
You can get access tokens for two different cases:
- You want your internal users to view a list of all target data models
- You want your customers to view a list of all target data models
You want your internal users to view all target data models
- To get the access token for an internal user, you need to first create an user in the Ingestro User Platform or use the user API
- Use the user’s email address and your license key to request the access token. Here is the cURL or JavaScript request you can use to get the access token:
curl -X 'POST' 'https://api-gateway.ingestro.com/dp/api/v1/access/token' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"license_key": LICENSE_KEY,
"auth": {
"identifier": E-MAIL,
"type": "USER"
}
}' # Replace LICENSE_KEY with your license key & E-MAIL with a user`s email
You want your customers to view all target data models
- To get the access token for your customer, you need to first create a sub-organization (sub-org) via the sub-organization API
- Use the sub-orgs’s identifier and your license key to retrieve the access token. Here is the cURL or JavaScript request you can use to retrieve the access token:
curl -X 'POST' 'https://api-gateway.ingestro.com/dp/api/v1/access/token' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"license_key": LICENSE_KEY,
"auth": {
"identifier": SUB_ORG_IDENTIFIER,
"type": "SUB_ORG"
}
}' # Replace LICENSE_KEY with your license key & SUB_ORG_IDENTIFIER with a sub-org identifier
Step 4: Implement the embeddable component in your application
With the package installed, you can add the TargetDataModelList component to your application.
First, import the component in the file where you want to use the TargetDataModelList component:
import { TargetDataModelList } from "@ingestro/pipelines-react";
import "@ingestro/pipelines-react/index.css";
Step 5: Configure the component based on your specific use case
Add the code snippet below and insert the component on the page where you want it to appear:
<TargetDataModelList
accessToken="ACCESS_TOKEN"
settings={{
i18nOverrides: {},
language: "en",
modal: false,
allowTargetDataModelCreation: false,
}}
onTargetDataModelView={({ data }) => {
// runs when the user clicks on one target data model in the list
// data: target data model object of the selected target data model
}}
onTargetDataModelCreate={() => {
// runs when the "Create target data model" button is pressed
}}
onClose={() => {
// runs when the creation workflow is closed via the "X" button or clicking outside the modal
}}
/>
accessToken
Add here the access token you've got in Step 3
settings
i18nOverrides
Allows you to override each text element in the interface
language
Defines the language of the embeddable (so far we only support English ("en"))
modal
Defines whether the component is shown inline (false) or within a modal view (true)
allowTargetDataModelCreation
Defines whether the "Create target data model" button is shown
onTargetDataModelView
Runs when the user clicks on a target data model. When defined, each target data model entry in the list shows a chevron on the right side that triggers this hook when clicked.
onTargetDataModelCreate
Runs when the user clicks on the "Create target data model" button
onClose
Runs when the user attempts to close the modal using the "X" button or clicking outside the modal