Skip to content

Instantly share code, notes, and snippets.

@brianleroux
Created February 2, 2018 22:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianleroux/6452ef85832fb0f08a412982cc0e8fe4 to your computer and use it in GitHub Desktop.
Save brianleroux/6452ef85832fb0f08a412982cc0e8fe4 to your computer and use it in GitHub Desktop.
module.exports = function addToSlack() {
let scope = 'commands,bot'
let clientID = process.env.SLACK_CLIENT_ID
let redirect = process.env.SLACK_INSTALL_REDIRECT
let href = `https://slack.com/oauth/authorize?scope=${scope}&client_id=${clientID}&redirect_uri=${redirect}`
return `
<a href=${href}>
<img alt="Add to Slack"
height="40"
width="139"
src="https://platform.slack-edge.com/img/add_to_slack.png"
srcset="https://platform.slack-edge.com/img/add_to_slack.png 1x, https://platform.slack-edge.com/img/add_to_slack@2x.png 2x">
</a>
`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment