Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/slack_oauth/src/index.ts>InstallProvider

Setup the OAuth flow for Slack apps easily. Deno port of @slack/oauth
Latest
class InstallProvider
import { InstallProvider } from "https://deno.land/x/slack_oauth@3.0.2/src/index.ts";

InstallProvider Class.

Constructors

new
InstallProvider(unnamed 0: InstallProviderOptions)

Properties

private
authorizationUrl: string
private
authVersion: string
private
clientId: string
private
clientOptions: WebClientOptions
private
clientSecret: string
private
logger: Logger
installationStore: InstallationStore
stateStore: StateStore

Methods

authorize(source: InstallationQuery<boolean>): Promise<AuthorizeResult>

Fetches data from the installationStore for non Org Installations.

generateInstallUrl(options: InstallURLOptions): Promise<string>

Returns a URL that is suitable for including in an Add to Slack button Uses stateStore to generate a value for the state query param.

handle(code: string, state: string): Promise<string>

This method handles the incoming request to the callback URL. It can be used as a RequestListener in almost any HTTP server framework.

Verifies the state using the stateStore, exchanges the grant in the query params for an access token, and stores token and associated data in the installationStore.