Skip to main content

Class: InstallProvider

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

Constructors

new InstallProvider()

new InstallProvider(__namedParameters): InstallProvider

Parameters

__namedParameters: InstallProviderOptions

Returns

InstallProvider

Defined in

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

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>

Fetches data from the installationStore

Parameters

source: InstallationQuery<boolean>

Returns

Promise<AuthorizeResult>

Defined in

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


generateInstallUrl()

generateInstallUrl(
options,
stateVerification,
state?): 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.

Parameters

options: InstallURLOptions

stateVerification: boolean = true

state?: string

Returns

Promise<string>

Defined in

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


handleCallback()

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

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>

Defined in

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


handleInstallPath()

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

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>

Defined in

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