{"id":15714295,"url":"https://github.com/slack-samples/javascript-channel-webhooks","last_synced_at":"2025-07-22T11:07:19.451Z","repository":{"id":37933511,"uuid":"94125188","full_name":"slackapi/template-channel-webhooks","owner":"slackapi","description":"Sample Slack app that uses a Bot to create per-channel webhooks","archived":false,"fork":false,"pushed_at":"2020-02-05T11:08:49.000Z","size":9,"stargazers_count":31,"open_issues_count":2,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-04T21:35:46.437Z","etag":null,"topics":["slack-blueprint"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/slackapi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-12T17:58:09.000Z","updated_at":"2023-08-02T04:03:42.000Z","dependencies_parsed_at":"2022-08-25T22:24:17.899Z","dependency_job_id":null,"html_url":"https://github.com/slackapi/template-channel-webhooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Ftemplate-channel-webhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Ftemplate-channel-webhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Ftemplate-channel-webhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/slackapi%2Ftemplate-channel-webhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/slackapi","download_url":"https://codeload.github.com/slackapi/template-channel-webhooks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219869309,"owners_count":16555579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["slack-blueprint"],"created_at":"2024-10-03T21:35:52.447Z","updated_at":"2025-07-22T11:07:17.821Z","avatar_url":"https://github.com/slackapi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Per-channel webhook template\n\nA bot that creates an incoming webhook URL for every channel it joins. Using the webhook URL, any user can set up integrations to post notifications into that channel.\n\n![channel-webhook-template](https://cloud.githubusercontent.com/assets/700173/26604820/75c658d4-4540-11e7-951d-f79a3d09a0fc.gif)\n\n## Setup\n\n#### Create a Slack app\n\n1. Create an app at api.slack.com/apps\n1. Click on `Bot Users`\n1. Add a bot user (choose a username and enable 'Always Show My Bot as Online')\n1. Click on `Install App` in the sidebar\n1. Install the app and copy the `xoxb-` token\n\n#### Run locally or [![Remix on Glitch](https://cdn.glitch.com/2703baf2-b643-4da7-ab91-7ee2a2d00b5b%2Fremix-button.svg)](https://glitch.com/edit/#!/remix/slack-channel-webhook-blueprint)\n1. Get the code\n    * Either clone this repo and run `npm install`\n    * Or visit https://glitch.com/edit/#!/remix/slack-channel-webhook-blueprint\n1. Set the following environment variables to `.env` (see `.env.sample`):\n    * `SLACK_TOKEN`: Your app's `xoxb-` token value (available on the Install App page)\n    * `SLACK_VERIFICATION_TOKEN`: Your app's verification token (available on the Basic Information page)\n    * `PORT`: The port that you're running ngrok on\n    * `BASE_URL`: Your ngrok URL\n1. If you're running the app locally:\n    1. Start the app (`npm start`)\n    1. In another windown, start ngrok on the same port as your webserver (`ngrok http $PORT`)\n\n#### Enable the Events API\n1. Go back to the app settings and click on Events Subscriptions.\n1. Set the Request URL to your ngrok or Glitch URL + /events\n1. On the same page, subscribe to the `member_joined_channel` [**bot** event](https://cloud.githubusercontent.com/assets/700173/26603331/4f188f90-453b-11e7-9b6d-9ca541f0cbf1.png)\n\n\n#### In Slack\n1. Invite the bot into a channel. You should see a message posted with the webhook URL\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslack-samples%2Fjavascript-channel-webhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fslack-samples%2Fjavascript-channel-webhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fslack-samples%2Fjavascript-channel-webhooks/lists"}