Download and view your slack history, channels and messages
Slack premium is pretty expensive for something simple and opensource. Use this to download and navigate your slack history, it will keep a record of the messages and files previously downloaded across channels and private messages.
- Clone the repo
- Install nodejs
- Install dependences
npm i - Optional: Get a trial of slack premium / pay for one month to get access for entire history
- Create a slack app and deploy to your workspace. In the
OAuth & Permissionssettings, ensure you have the followingUser Token Scopes:(see config image 1 below)- channels:history
- channels:read
- files:read
- groups:read
- groups:history
- im:history
- im:read
- mpim:history
- mpim:read
- remote_files:read
- users:read
- Copy the
.env.examplefile to.env - In the slack
OAuth & Permissionssettings, get theUser OAuth Tokenfrom the slack app and add to your.envfile as theSLACK_BOT_TOKENproperty(see config image 2 below) - Add the slack space id (also known as, team ID) from your slack workspace and add to your
.envfile as theSLACK_SPACEproperty - Get this by opening slack in browser and looking at the URL(see config image 3 below) - Optional: You can download only specific channels (and files in those channels) by including a
SLACK_CHANNELSvariable in your.envfile. This can be a single channel id, or mutiple channel IDs separated with a comma (no space). Omitting this variable will download all channels and files. Get this by opening slack in browser and looking at the URL(see config image 3 below) - Optional: If you don't want to download files (can take a while - Although, if they have been downloaded once, they won't be downloaded each time). You can surpress file downloading completely by adding
DONT_DOWNLOAD_FILES=trueto your.env - Optional: Add a
STATIC_PASSWORDproperty to the.envfile if you wish to usenetlify devlocally - Run
npm startornode app.jsto begin downloading your slack messages and files - All files added to
_static/files/*folder. All data added to_static/data/data.json - To run the slack viewer on your local machine (it is static, no server-side code or logic), run a static web server in in the
_staticdirectory. Eg,npm i -g serveand thenserve ./_static(npm run staticin this package.json) - Open in your webserver - All history is stored in the hash as an SPA, all messages are indexed and searchable, as well as all files viewable and downloadable
- Optional: You can deploy to any public static server as you see fit. In this example, you can deploy to netlify by installing netlify and running
npm run deploy. In the free version of netlify if you want a very (frail) basic security, set an environment variable forSTATIC_PASSWORDin the console. A better alternative would be to pay for a static site with password protection. Netlify will currently allow lots of files. Any additional deploys will calculate the hashes of the files and will reduce future deployment times dramatically to a few seconds.



