Skip to main content

@slack/oauth / InstallProvider

Class: InstallProvider

Defined in: packages/oauth/src/install-provider.ts:32

InstallProvider Class. Refer to InsallProviderOptions interface for the details of constructor arguments.

Constructors​

Constructor​

new InstallProvider(__namedParameters): InstallProvider;

Defined in: packages/oauth/src/install-provider.ts:87

Parameters​

__namedParameters​

InstallProviderOptions

Returns​

InstallProvider

Properties​

installationStore​

installationStore: InstallationStore;

Defined in: packages/oauth/src/install-provider.ts:38


stateStore?​

optional stateStore?: StateStore;

Defined in: packages/oauth/src/install-provider.ts:35

Methods​

authorize()​

authorize(source): Promise<AuthorizeResult>;

Defined in: packages/oauth/src/install-provider.ts:177

Fetches data from the installationStore

Parameters​

source​

InstallationQuery<boolean>

Returns​

Promise<AuthorizeResult>


generateInstallUrl()​

generateInstallUrl(
options,
stateVerification?,
state?): Promise<string>;

Defined in: packages/oauth/src/install-provider.ts:415

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.

Parameters​

options​

InstallURLOptions

stateVerification?​

boolean = true

state?​

string

Returns​

Promise<string>


handleCallback()​

handleCallback(
req,
res,
options?,
installOptions?): Promise<void>;

Defined in: packages/oauth/src/install-provider.ts:485

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.

Parameters​

req​

IncomingMessage

res​

ServerResponse

options?​

CallbackOptions

installOptions?​

InstallURLOptions

Returns​

Promise<void>


handleInstallPath()​

handleInstallPath(
req,
res,
options?,
installOptions?): Promise<void>;

Defined in: packages/oauth/src/install-provider.ts:330

Handles the install path (the default is /slack/install) requests from an app installer.

Parameters​

req​

IncomingMessage

res​

ServerResponse

options?​

InstallPathOptions

installOptions?​

InstallURLOptions

Returns​

Promise<void>