Skip to content

Latest commit

 

History

History
51 lines (40 loc) · 1.43 KB

README.md

File metadata and controls

51 lines (40 loc) · 1.43 KB

Still in Development

Conductor

An extension of slack bolt-js framework to help manage your sessions, installations, conversations, and channel event routing.

Development

    yarn install
    yarn link

    # starts a tsc -w
    yarn dev

Usage

        const receiver = new ExpressReceiver({ signingSecret: slackConfig.signingSecret });
        const router = receiver.router;
        
        const c = new Conductor({
            host: '127.0.0.1',
            router: router
        });
        
        this.app = new SlackApp({
            signingSecret: slackConfig.signingSecret,
            clientId: slackConfig.clientId,
            clientSecret: slackConfig.clientSecret,
            // stateSecret: 'super-duper-secret',
            scopes: slackConfig.scopes,
            // authorize: lb.authorize,
            // In your app instance
            installationStore: {
                storeInstallation: async (installation) => {
                    return await c.saveInstallation(installation.team.id, installation);
                },
                fetchInstallation: async (InstallQuery) => {
                    return await c.fetchInstallation(InstallQuery.teamId);
                },
            },
            receiver,
        });

        this.app.error(lb.handleError);
        this.app.use((args) => c.listen({ ...args }));
        this.app.use((args) => c.shouldProcess({ ...args }));