Search code examples
slackslack-api

Test slack action buttons locally


I have a slack app and using ngrok to test it, so far worked fine, the problem is that the app is now live and I want to test an action button. On the Interactive Components section I have set the Request URL to

https://www.myapp.com

How can I test local changes to code without changing the Request URL on the app settings ?


Solution

  • You can't. Especially if you are using the free tier version of ngrok, where the URL changes at every restart.

    I am using ngrok for developing and testing too, and my approach to this problem is to have two Slack apps:

    • One for production use, with its scripts and database running on my production webserver.
    • One for development and testing. With the code and database running on my local machine.

    You obviously have to keep the two Slack apps in sync manually, but since its just a few configuration parameters its doable.

    And if you want to run a more professional setup, you actually want to have a 3rd clone for testing only.