Skip to main content

Interface: CallbackOptions

Properties

afterInstallation()?

optional afterInstallation: (installation, options, callbackReq, callbackRes) => Promise<boolean>;

An additional logic to run right after executing the Slack app installation with the given OAuth code parameter.

When this method returns false, the InstallProvider skips storing the installation in database. You can set false when your app needs to cancel the installation (you can call auth.revoke API method for it) and then, the app needs to display an error page to the installing user.

Also, when returning false, this method is responsible to call callbackRes#end() method to build complete HTTP response for end-users.

Parameters

installation: Installation<"v1" | "v2", boolean> | OrgInstallation

options: InstallURLOptions

callbackReq: IncomingMessage

callbackRes: ServerResponse

Returns

Promise<boolean>

Defined in

packages/oauth/src/callback-options.ts:33


beforeInstallation()?

optional beforeInstallation: (options, callbackReq, callbackRes) => Promise<boolean>;

An additional logic to run right before executing the Slack app installation with the given OAuth code parameter.

When this method returns false, the InstallProvider skips the installation. You can set false when the visiting user is not eligible to proceed with the Slack app installation flow.

Also, when returning false, this method is responsible for calling the callbackRes#end() method to build a complete HTTP response for end-users.

Parameters

options: InstallURLOptions

callbackReq: IncomingMessage

callbackRes: ServerResponse

Returns

Promise<boolean>

Defined in

packages/oauth/src/callback-options.ts:17


failure()?

optional failure: (error, options, callbackReq, callbackRes) => void;

Parameters

error: CodedError

options: InstallURLOptions

callbackReq: IncomingMessage

callbackRes: ServerResponse

Returns

void

Defined in

packages/oauth/src/callback-options.ts:63


failureAsync()?

optional failureAsync: (error, options, callbackReq, callbackRes) => Promise<void>;

Parameters

error: CodedError

options: InstallURLOptions

callbackReq: IncomingMessage

callbackRes: ServerResponse

Returns

Promise<void>

Defined in

packages/oauth/src/callback-options.ts:72


success()?

optional success: (installation, options, callbackReq, callbackRes) => void;

Parameters

installation: Installation<"v1" | "v2", boolean> | OrgInstallation

options: InstallURLOptions

callbackReq: IncomingMessage

callbackRes: ServerResponse

Returns

void

Defined in

packages/oauth/src/callback-options.ts:43


successAsync()?

optional successAsync: (installation, options, callbackReq, callbackRes) => Promise<void>;

Parameters

installation: Installation<"v1" | "v2", boolean> | OrgInstallation

options: InstallURLOptions

callbackReq: IncomingMessage

callbackRes: ServerResponse

Returns

Promise<void>

Defined in

packages/oauth/src/callback-options.ts:52