linkIntegration Setup

circle-info

For more detailed GL Connectors SDK Capabilities, please check SDK Method API

Authentication

circle-exclamation

Before executing the integration actions, you need to authenticate and obtain the user token first. Outside of Connectors Console, we provide a multi-tenant environment that requires you to manage your Client API Key and User Credentials yourself.

Register user

triangle-exclamation

To create a new user, you need to input your identifier for your user.

from gl_connectors_sdk.connector import GLConnectors

connector = GLConnectors(api_base_url="https://connector.gdplabs.id", api_key="YOUR_API_KEY")

user = connector.create_user("your-user-identifier")
user_secret = user_data.secret # store this securely! we only show this once!

Logging in and Retrieving User Token

After creating the user, you can authenticate (login) with your Connector API key.

from gl_connectors_sdk.connector import GLConnectors

# Initialize the connector
connector = GLConnectors(api_base_url="https://connector.gdplabs.id", api_key="YOUR_API_KEY")

user = connector.authenticate("identifier", "sk-user-xxx")
user_token = user.token  # eyJ... (the Bearer Token)

Once you have the token, use it to connect to the connectors. For most configurations, we will generate an URL that you can follow to authenticate. But some connectors require custom configuration.

Setting up an Integration

circle-exclamation

To set up a certain integration (e.g., github, google, gdrive, etc.), you need to request a connector authentication, which will create an OAuth2 login URL, which you can then follow to link an integration to your account.

Setting up a Custom Integration

circle-exclamation

Unlike the previous section, this section highlights if you need to bring a custom configuration to modules that support it. For example, SQL Connection. The complete documentation can be found here in SQL.

Multiple Integration

A GL Connector user may add multiple integrations to a connector. When running the connector, you can choose an integration; otherwise the first integration added (the default) is used. The default integration can be changed or deleted.

Execute with Specific Integration

There are two ways to specify which integration to use when executing connector:

  1. Parameter identifier: str on execute(...)

  1. Method identifier(identifier: str | None = None) on GL Connectors Fluent.

Change Default Integration

The default integration can be changed. See the example code below.

Delete Integration

An integration can be deleted. If the default integration is deleted, the most recently created integration becomes the new default. Example code for deleting an integration is shown below.

Last updated