Installations
Some providers separate app-level credentials from user-level credentials. A Slack bot installed in a workspace has its own token. Individual users within that workspace may also have personal OAuth grants. Authpipe models this with installations (app-level) and connections (user-level).
When to use installations
Section titled “When to use installations”Use installations when the provider has an app/bot model:
| Provider | Installation | User Connection |
|---|---|---|
| Slack | Bot token for the workspace | Individual user’s OAuth token |
| GitHub App | App installation token for the org | User’s personal access token |
| Microsoft Teams | App registration in a tenant | User’s delegated token |
Providers that don’t have an installation model (e.g., Google Drive, Dropbox) use connections directly.
Create an install session
Section titled “Create an install session”const session = await authpipe.createInstallSession({ provider: "slack", tenantId: "org_acme", userId: "user_admin", redirectUrl: "https://yourapp.com/integrations/installed", permissions: ["channels:read", "chat:write"],});
// Redirect admin to session.authorization_urlres.redirect(session.authorization_url);session, err := client.CreateInstallSession(ctx, &authpipe.CreateInstallSessionParams{ Provider: "slack", TenantID: "org_acme", UserID: "user_admin", RedirectURL: "https://yourapp.com/integrations/installed", Permissions: []string{"channels:read", "chat:write"},})session = client.create_install_session( provider="slack", tenant_id="org_acme", user_id="user_admin", redirect_url="https://yourapp.com/integrations/installed", permissions=["channels:read", "chat:write"],)After the admin completes the installation flow, Authpipe stores the installation with a bot/app token.
Two-tier credential retrieval
Section titled “Two-tier credential retrieval”With both an installation and user connections, getCredential resolves across both tiers.
Default: try connection, fall back to installation
Section titled “Default: try connection, fall back to installation”const result = await authpipe.getCredential({ provider: "slack", tenantId: "org_acme", userId: "user_jane",});// If user_jane has a connection → returns her token (source: "connection")// If not → returns the bot token (source: "installation")Installation only
Section titled “Installation only”const result = await authpipe.getCredential({ provider: "slack", tenantId: "org_acme", credentialFor: "installation",});// Always returns the bot token, ignoring connectionsUser only (no fallback)
Section titled “User only (no fallback)”const result = await authpipe.getCredential({ provider: "slack", tenantId: "org_acme", userId: "user_jane", credentialFor: "user",});// Returns user_jane's token, or fails if she hasn't connectedManaging installations
Section titled “Managing installations”Search installations
Section titled “Search installations”const installations = await authpipe.searchInstallations({ filter: { tenant_id: { eq: "org_acme" } },});resp, err := client.SearchInstallations(ctx, &authpipe.SearchRequest{ Filter: map[string]map[string]interface{}{ "tenant_id": {"eq": "org_acme"}, },})from authpipe.types import SearchRequest
resp = client.search_installations(SearchRequest( filter={"tenant_id": {"eq": "org_acme"}},))Get an installation
Section titled “Get an installation”const installation = await authpipe.getInstallation("inst_abc123");inst, err := client.GetInstallation(ctx, "inst_abc123")inst = client.get_installation(installation_id="inst_abc123")Delete an installation
Section titled “Delete an installation”Deleting an installation sets its status to deleted and revokes all child connections.
await authpipe.deleteInstallation("inst_abc123");err := client.DeleteInstallation(ctx, "inst_abc123")client.delete_installation(installation_id="inst_abc123")Reinstallation
Section titled “Reinstallation”If the same app is reinstalled in the same external workspace, Authpipe upserts the existing installation (updates tokens and permissions) instead of creating a duplicate. The provider_installation_id is the deduplication key.