Skip to content

Slack App Integration#2041

Merged
zomars merged 117 commits intomainfrom
sean-monorepo-slack-oauth
Apr 6, 2022
Merged

Slack App Integration#2041
zomars merged 117 commits intomainfrom
sean-monorepo-slack-oauth

Conversation

@sean-brydon
Copy link
Copy Markdown
Member

@sean-brydon sean-brydon commented Mar 2, 2022

What does this PR do?

Slack App setup.

Implemented the ability for slack to send requests on events (commands etc) - This only works if slacks signature matches with our signature

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How should this be tested?

Obtaining Slack Client ID and Secret and Signing Secret

To test this you will need to create a Slack app for yourself on their apps website.

Copy and paste the app manifest below into the setting on your slack app. Be sure to replace YOUR_DOMAIN with your own domain or your proxy host if you're testing locally.

App Manifest
display_information:
 name: Cal.com Slack
features:
 bot_user:
   display_name: Cal.com Slack
   always_online: false
 slash_commands:
   - command: /create-event
     url: https://YOUR_DOMAIN/api/integrations/slackmessaging/commandHandler
     description: Create an event within Cal!
     should_escape: false
   - command: /today
     url: https://YOUR_DOMAIN/api/integrations/slackmessaging/commandHandler
     description: View all your bookings for today
     should_escape: false
   - command: /links
     url: https://YOUR_DOMAIN/api/integrations/slackmessaging/commandHandler
     description: View all your Cal.com links
     should_escape: false
oauth_config:
 redirect_urls:
   - https://YOUR_DOMAIN/api/integrations/slackmessaging/callback
 scopes:
   bot:
     - chat:write
     - commands
settings:
 interactivity:
   is_enabled: true
   request_url: https://YOUR_DOMAIN/api/integrations/slackmessaging/interactiveHandler
   message_menu_options_url: https://YOUR_DOMAIN/api/integrations/slackmessaging/interactiveHandler
 org_deploy_enabled: false
 socket_mode_enabled: false
 token_rotation_enabled: false

Add the integration as normal - slack app - add. Follow the oauth flow to add it to a server.

Next make sure you have your app running yarn dx. Then in the slack chat type one of these commands: /create-event or /today or /links

NOTE: Next you will need to setup a proxy server like ngrok to allow your local host machine to be hosted on a public https server.

Checklist

  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my PR needs changes to the documentation
  • I haven't added tests that prove my fix is effective or that my feature works

@vercel vercel Bot temporarily deployed to Preview – docs March 28, 2022 21:39 Inactive
Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're almost there. Let's just figure out the connection error on the Slack modal.

Comment thread apps/web/pages/api/integrations/[...args].ts
Comment thread packages/app-store/components.tsx Outdated
Comment thread packages/prisma/schema.prisma
@vercel vercel Bot temporarily deployed to Preview – docs March 28, 2022 21:41 Inactive
@zomars zomars marked this pull request as ready for review March 28, 2022 21:41
@vercel vercel Bot temporarily deployed to Preview – calendso March 28, 2022 21:43 Inactive
@vercel vercel Bot temporarily deployed to Preview – calendso March 29, 2022 17:54 Inactive
@vercel vercel Bot temporarily deployed to Preview – docs March 29, 2022 17:54 Inactive
@vercel vercel Bot temporarily deployed to Preview – docs April 3, 2022 16:33 Inactive
@vercel vercel Bot temporarily deployed to Preview – calendso April 3, 2022 16:33 Inactive
@zomars zomars requested review from alannnc, joeauyeung and zomars April 3, 2022 16:50
@sean-brydon sean-brydon requested a review from a team April 4, 2022 10:05
@vercel vercel Bot temporarily deployed to Preview – docs April 4, 2022 10:29 Inactive
@vercel vercel Bot temporarily deployed to Preview – calendso April 4, 2022 10:29 Inactive
Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's solve these type errors @sean-brydon

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ autoupdate tells kodiak to keep this branch up-to-date

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants