Secure approaches to managing API credentials with superglue
superglue handles credential management primarily through its encrypted vault. You can also pass credentials at runtime, which is useful for multi-user scenarios.
Flexible Credential Naming: The exact naming of credentials, except for OAuth cases, is not vital, since superglue maps credentials to the request automatically. This means that e.g. if the token has to be passed as a X-SERVICE-API-KEY, it is acceptable to name the token “api_key”. Given documentation and context, superglue will figure out how to place the API key to successfully complete the request.
superglue handles OAuth automatically! Token refresh, expiration management, and OAuth flows are all managed by superglue. You just need to provide the initial OAuth credentials.
What superglue handles for you:
✅ Token refresh when expired
✅ OAuth flow management
✅ Scope validation
✅ Rate limiting with OAuth APIs
✅ Error handling for token issues
What you need to provide:
Client ID and Client Secret
Scopes (if custom)
Authorization URL (if not using templates)
Copy
Ask AI
// Simple OAuth setup - superglue does the restawait superglue.upsertIntegration("hubspot-oauth", { id: "hubspot-oauth", name: "HubSpot OAuth", urlHost: "https://api.hubapi.com", credentials: { client_id: "your_hubspot_client_id", client_secret: "your_hubspot_client_secret", // superglue handles token refresh automatically }, specificInstructions: "Use OAuth2 with contacts and deals scopes"});// Use it in workflows - no token management neededconst workflow = await superglue.buildWorkflow({ instruction: "Get all HubSpot contacts created this month", integrationIds: ["hubspot-oauth"]});const result = await superglue.executeWorkflow({ workflow });
We have pre-built OAuth templates for popular APIs like HubSpot, Google Ads, Salesforce, and more. You can create a new integration and check the templates to see what is available. If an integration is not available, you can always create it manually and add auth url and scopes. Talk to us if you need help with this.
// Stored credentials (connection string)await superglue.upsertIntegration({ id: "main-db", urlHost: "postgresql://<<user>>:<<password>>@<<host>>:<<port>>", urlPath: "/<<database_name>>", credentials: { user: "user", password: "pass", host: "host", port: 5432, database: "db", },});const result = await superglue.executeWorkflow({ workflowId: "db-query", integrationIds: ["main-db"]});// Runtime credentials - this can be useful if you want to connect to different databases with one workflow (e.g. one set of credentials for each user)const result = await superglue.executeWorkflow({ workflowId: "db-query", credentials: { user: "user", password: "pass", host: "host", port: 5432, database: "db", }});
For oauth integrations, you might need to authenticate the user through the web interface. To do so, set the client id and client secret, then open the integration in the web interface and click “Save” to open the authentication flow. Alternatively, you can set access token and refresh token manually:
Copy
Ask AI
// Stored OAuth tokensawait superglue.upsertIntegration({ id: "hubspot-crm", credentials: { access_token: "pat-na1-...", // optional - alternatively create a new integration in the browser and authenticate there refresh_token: "refresh_token_here", // optional client_id: "your_app_client_id", client_secret: "your_app_client_secret", },});// Runtime OAuth tokensconst result = await superglue.executeWorkflow({ workflowId: "hubspot-sync", credentials: { hubspot_token: await getValidHubSpotToken(userId), },});
Use superglue-managed credentials:✅ Faster setup and iteration
✅ No credential management complexity
✅ Easy testing across team members
✅ Built-in credential validation