Provision Customer Connections to Your App
Your custom connector for your app likely requires authentication, but it feels strange to ask your customers to authenticate with your app when they're already logged in to your app.
The solution is to create customer connections on behalf of your customers, so they don't have to authenticate with your app separately.
If you'd like to provision customer connections programmatically, first create the connection and take note of its ID (it'll start with U2N...).
Then, take note of your customer's ID (it'll start with Q3V...).
With both IDs in hand, create a customer connection, filling inputs with the keys and values required by your custom connector. Here's an example GraphQL mutation:
Create a Customer Connection
mutation {
createCustomerConfigVariable(
input: {
scopedConfigVariable: "U2N-YOUR-CONNECTION-ID"
customer: "Q3V-YOUR-CUSTOMER-ID"
isTest: false
inputs: [
{ name: "api_key", type: "value", value: "my-customers-api-key" }
]
}
) {
customerConfigVariable {
id
}
errors {
field
messages
}
}
}