Skip to main content
Each supported platform has its own connection function, and oauthConnection() connects any other provider that follows standard OAuth 2.0 from its endpoints. For a provider that departs from the standard, pass oauthConnection() a profile that describes how to run its flow.

Profile hooks

A profile is a set of hooks that the connection calls at each step of the flow. In Python, the names are snake_case, such as construct_authorize_params.

Adjust the standard profile

constructStandardProfile() builds the profile of a standard provider, which issues one token named default. It’s exported from @agentjam/sdk/oauth (agentjam.oauth in Python), along with the types for writing hooks. Override the hooks where your provider differs:
For a provider whose token responses contain several nested tokens, parseStandardToken() (parse_standard_token() in Python) reads the standard fields of one token, so a custom parseTokens can call it once per token.

Adjust a platform profile

Each platform’s module also exports the profile its connection function uses, such as slackProfile from @agentjam/sdk/slack (slack_profile from agentjam.slack in Python). To change one of its hooks, copy the profile with your change, and pass the copy to oauthConnection() under the platform’s provider name:
The other platforms export googleProfile, githubProfile, and sentryProfile. For a GitHub App, constructGitHubAppProfile(slug) (construct_github_app_profile(slug) in Python) builds the app’s profile.

Bring your own credentials

Any credential source, such as a credential vault, can stand in for oauthConnection() in a skill’s connections. It implements the CredentialSource interface, whose methods include authorize(), which returns the link where the human connects their account, and token(), which returns a current access token.