# Slack Bots on Sprites: OAuth is Easy Now

DevFeed: [Slack Bots on Sprites: OAuth is Easy Now](<https://devfeed.tech/articles/slack-bots-on-sprites-oauth-is-easy-now-122063.md>)

Original publisher: [Read original article](<https://fly.io/blog/slack-bots-on-sprites/>)

Author: Daniel Botha

Published: 2026-01-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Fly](<https://devfeed.tech/sources/the-fly-blog.md>)

Topics: [Slack](<https://devfeed.tech/topics/slack.md>), [OAuth](<https://devfeed.tech/topics/oauth.md>), [hosting](<https://devfeed.tech/topics/hosting.md>), [OAuth 2.0](<https://devfeed.tech/topics/oauth2.md>)

Tags: [access-tokens](<https://devfeed.tech/tags/access-tokens.md>), [accessible](<https://devfeed.tech/tags/accessible.md>), [authorization](<https://devfeed.tech/tags/authorization.md>), [automatic](<https://devfeed.tech/tags/automatic.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [bolt](<https://devfeed.tech/tags/bolt.md>), [bot](<https://devfeed.tech/tags/bot.md>), [bots](<https://devfeed.tech/tags/bots.md>), [build](<https://devfeed.tech/tags/build.md>), [callback](<https://devfeed.tech/tags/callback.md>), [code-assistant](<https://devfeed.tech/tags/code-assistant.md>), [command](<https://devfeed.tech/tags/command.md>), [console](<https://devfeed.tech/tags/console.md>), [dependencies](<https://devfeed.tech/tags/dependencies.md>), [easy](<https://devfeed.tech/tags/easy.md>), [environment](<https://devfeed.tech/tags/environment.md>), [express](<https://devfeed.tech/tags/express.md>), [oauth](<https://devfeed.tech/tags/oauth.md>), [slack](<https://devfeed.tech/tags/slack.md>), [slack-bot](<https://devfeed.tech/tags/slack-bot.md>), [slack-oauth](<https://devfeed.tech/tags/slack-oauth.md>), [sprites](<https://devfeed.tech/tags/sprites.md>), [the-fly-blog](<https://devfeed.tech/tags/the-fly-blog.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

## AI overview

The article explains how to run a Slack bot on a Sprite, using its public URL and persistent filesystem to handle Slack OAuth callbacks and retain tokens across restarts. It walks through creating a Sprite, installing Bolt and Express, building a server on port 8080, registering it with `sprite-env services create ... --http-port 8080`, and setting a public URL and Slack app credentials. The service manager wakes the Sprite for HTTP requests, routes traffic to the specified port, and preserves service registration; idle Sprites hibernate and are said to wake in under a second. A checkpoint can snapshot the environment for restoration. The excerpt gives setup instructions but does not include the actual server implementation.

## Source excerpt

Slack bots are handy, but they typically require OAuth, which means you need a server with a public URL to handle callbacks. This is annoying. But with Sprites, you get an instant internet-accessible environment with a persistent filesystem that makes it trivial. OAuth Pain Getting your Slack bot working involves jumping through these OAuth hurdles: Create an endpoint to receive Slack's authorization callback Get that endpoint online with a public URL Securely store tokens after the callback Maintain those tokens across restarts This requires deploying something to a host, setting up Ngrok and implementing a storage solution for tokens. Slack Bot Sprites Create a Sprite for your bot: Wrap text Copy to clipboard sprite create slack-bot sprite console -s slack-bot Install your dependencies: Wrap text Copy to clipboard npm init -y npm install @slack/bolt express Build an OAuth Handler Now we need a server that: Handles the OAuth callback from Slack Stores access tokens to the filesystem Loads those tokens when the server restarts Implements your bot's functionality Ask your code assistant to: "Create a server.js file that handles Slack OAuth callbacks using the Bolt framework, stores tokens to the filesystem, and implements a simple slash command. The server should run on port 8080." Register Your Slack Bot as a Sprite Service Sprites don't use systemd or traditional init systems. Instead, they have their own service manager that enables the Sprite's automatic sleep/wake behavior. So you'll want to register your bot as a service with the HTTP port flag: Wrap text Copy to clipboard sprite-env services create slack-bot --cmd node --args server.js --http-port 8080 This does three critical things: Auto-start on HTTP requests: When a request hits your Sprite URL, the Sprite wakes from hibernation Auto-route requests: The Sprite proxy routes incoming traffic to your specified port (8080) Persistent registration: Your service registration survives Sprite restarts and hibernat