With React
npm install --save @stackone/react-hub
yarn add @stackone/react-hub
/connect_sessions
endpoint.Since this involves sending the API Key and other sensitive data, the recommended approach is to make this request through your application backend avoiding the need for exposing credentials in the frontend code.As an example, assuming that the application backend already has that endpoint a function to retrieve the connection session token could be as simple as:provider
property so the integration hub will directly filter or load the given provider or category instead of displaying a list of all integrations enabled.Without React
Customizing the hub style
styles
property:origin_owner_id
and origin_owner_name
are required, while origin_username
is optional. If the origin_owner_id
, origin_owner_name
, and provider
have been used previously, the existing account will be updated; otherwise, a new account will be created.
Additionally, you can add the following fields to control the behavior of the connect session token.
Field | Description |
---|---|
label | A label is a text field that can be used to store any string data against the account |
category | The hub page will open at the category selector (HRIS, ATS etc) where the user can go through the remaining steps to complete adding the new account. |
provider | The Hub page will open directly at the final stage where the user can enter the credentials and complete the last steps to complete adding the new account. |
account_id | If an existing account id is included in the connect session then the hub will open on the Edit Account page where the credentials can be updated and the account can be re-linked |
/connect_sessions
endpoint with the credentials and the request data. If the request is successful, it will respond with an object that contains a token
property. This token will be returned and can then be used by the frontend to connect the React Hub with your application. When the frontend process is completed an Account will either be created or updated.
origin_owner_id
should always be set via server-side logic and not be passed through directly via the client-side request.Advanced Use Case
Fields | Details Used Before? | Description | Account Action |
---|---|---|---|
origin_owner_id origin_user_name origin_name category (optional)provider (optional) | No | A new account will be created. If the category is specified, the hub will open in the provider selection screen; otherwise, it will open with the selected provider. | Create |
origin_owner_id origin_user_name origin_name | Yes | The existing account will be opened in edit mode. | Update |
provider
or categories
property so the integration hub will directly filter or load the given integration (provider
) or categories
.The values accepted in the provider
property can be found in the Supported Providers list in the Provider Key
column.If the provider
is left undefined, the StackOne integrations hub will display a list of all integrations enabled for the project associated with the given API key.