Skip to content

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).

Use installations when the provider has an app/bot model:

ProviderInstallationUser Connection
SlackBot token for the workspaceIndividual user’s OAuth token
GitHub AppApp installation token for the orgUser’s personal access token
Microsoft TeamsApp registration in a tenantUser’s delegated token

Providers that don’t have an installation model (e.g., Google Drive, Dropbox) use connections directly.

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_url
res.redirect(session.authorization_url);

After the admin completes the installation flow, Authpipe stores the installation with a bot/app token.

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")
const result = await authpipe.getCredential({
provider: "slack",
tenantId: "org_acme",
credentialFor: "installation",
});
// Always returns the bot token, ignoring connections
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 connected
const installations = await authpipe.searchInstallations({
filter: { tenant_id: { eq: "org_acme" } },
});
const installation = await authpipe.getInstallation("inst_abc123");

Deleting an installation sets its status to deleted and revokes all child connections.

await authpipe.deleteInstallation("inst_abc123");

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.