A modernized version of the public Slack invite system, updated for 2025 with the latest dependencies and Node.js features.
This is a completely modernized version of the original slackin project with:
- Express 5.1.0 (latest) - from Express 4.15.4
- Socket.io 4.8.1 (latest) - from Socket.io 2.0.3
- Node.js 18+ support - from Node.js 6.11.1
- ES Modules - converted from CommonJS
- Modern HTTP client - replaced superagent with undici
- Zero vulnerabilities - all dependencies updated and secure
- Removed Babel transpilation (native ES modules)
- Removed Gulp build system (no longer needed)
- Updated to modern async/await patterns
- Improved error handling and logging
- Built-in body parsing (Express 5.x)
- Graceful shutdown handling
- Latest Express with security improvements
- Updated reCAPTCHA integration
- Modern IP address handling
- Secure dependency versions
- Node.js 18.0.0 or higher
- Slack API token with admin privileges
- Google reCAPTCHA site key and secret
π Need help getting tokens? See SETUP.md for detailed step-by-step instructions.
β Slackin works on Slack FREE plans!
- Works with free Slack workspaces (with limitations)
- You must be a workspace admin to generate API tokens
- User count updates will be slower due to 2025 API rate limits
- Uses 1 of your 10 allowed app installations
π Full details: See Free Plan Summary in SETUP.md
# Clone the repository
git clone https://github.com/Aswintechie/slack-join.git
cd slack-join
# Install dependencies
npm install
# Set up environment variables
cp env.example .env
# Edit .env with your Slack and reCAPTCHA credentials
# See SETUP.md for detailed instructions on getting tokens
# Start the server
npm startOption 1: Using .env file (Recommended)
Copy the example environment file and edit it with your values:
cp env.example .env
# Edit .env with your actual valuesOption 2: Export manually
Set these environment variables or pass them as command line arguments:
export SLACK_SUBDOMAIN=your-team-name
export SLACK_API_TOKEN=xoxp-your-token
export GOOGLE_CAPTCHA_SECRET=your-secret
export GOOGLE_CAPTCHA_SITEKEY=your-sitekey| Token | Where to Get It | Example |
|---|---|---|
SLACK_SUBDOMAIN |
Your Slack URL: https://TEAM.slack.com |
mycompany |
SLACK_API_TOKEN |
Slack API | xoxp-123... |
GOOGLE_CAPTCHA_SECRET |
reCAPTCHA Admin | 6LcYYY... |
GOOGLE_CAPTCHA_SITEKEY |
reCAPTCHA Admin | 6LcXXX... |
π Detailed instructions: See SETUP.md for complete step-by-step guides.
# Basic usage
node bin/slackin.js team-name api-token captcha-secret captcha-sitekey
# With options
node bin/slackin.js \
--port 3000 \
--hostname 0.0.0.0 \
--channels "general,random" \
--cors \
team-name api-token captcha-secret captcha-sitekey# Auto-restart on changes (Node 18+ built-in)
npm run dev| Option | Environment Variable | Description | Default |
|---|---|---|---|
--port |
PORT |
Port to listen on | 3000 |
--hostname |
HOSTNAME |
Hostname to bind to | 0.0.0.0 |
--channels |
SLACK_CHANNELS |
Comma-separated channel list | All channels |
--interval |
SLACK_INTERVAL |
Polling interval (ms) | 5000 |
--cors |
- | Enable CORS | false |
--silent |
- | Disable logging | false |
--coc |
- | Code of Conduct URL | none |
--css |
- | Custom CSS URL | none |
npm install -g pm2
# Create ecosystem file
cat > ecosystem.config.js << 'EOF'
module.exports = {
apps: [{
name: 'slackin',
script: 'bin/slackin.js',
env: {
NODE_ENV: 'production',
PORT: 3000,
SLACK_SUBDOMAIN: 'your-team',
SLACK_API_TOKEN: 'xoxp-your-token',
GOOGLE_CAPTCHA_SECRET: 'your-secret',
GOOGLE_CAPTCHA_SITEKEY: 'your-sitekey'
}
}]
}
EOF
# Start with PM2
pm2 start ecosystem.config.jsFROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
USER node
EXPOSE 3000
CMD ["node", "bin/slackin.js"][Unit]
Description=Slackin Slack Invite System
After=network.target
[Service]
Type=simple
User=node
WorkingDirectory=/opt/slackin
ExecStart=/usr/bin/node bin/slackin.js
Restart=always
RestartSec=10
Environment=NODE_ENV=production
Environment=PORT=3000
Environment=SLACK_SUBDOMAIN=your-team
Environment=SLACK_API_TOKEN=xoxp-your-token
Environment=GOOGLE_CAPTCHA_SECRET=your-secret
Environment=GOOGLE_CAPTCHA_SITEKEY=your-sitekey
[Install]
WantedBy=multi-user.targetGET /- Slack invite pagePOST /invite- Submit invite requestGET /iframe- Embeddable iframeGET /iframe/dialog- Iframe dialog versionGET /badge.svg- SVG status badgeGET /data- JSON status data
<iframe
src="https://your-domain.com/iframe"
width="174"
height="30"
frameborder="0">
</iframe>slack-join/
βββ bin/
β βββ slackin.js # CLI entry point
βββ lib/
β βββ index.js # Main server logic
β βββ slack.js # Slack API integration
β βββ slack-invite.js # Invite functionality
β βββ vd-wrapper.js # Virtual DOM wrapper
β βββ splash.js # Main page template
β βββ iframe.js # Iframe template
β βββ badge.js # SVG badge generator
β βββ log.js # Logging utilities
β βββ assets/ # Static assets
βββ package.json # Dependencies and scripts
βββ README.md # This file
- express ^5.1.0 - Web framework
- socket.io ^4.8.1 - Real-time communication
- undici ^7.11.0 - Modern HTTP client
- virtual-dom ^2.1.1 - Virtual DOM for templates
- email-regex ^1.0.0 - Email validation
- cors ^2.8.5 - CORS handling
If you're migrating from the original slackin:
- Node.js: Update to Node.js 18+
- Dependencies: Run
npm install(all updated automatically) - Environment: Same environment variables work
- API: All endpoints remain compatible
- Build: No build step required (removed Babel/Gulp)
- Node.js 18+ required (was 6.11.1)
- ES Modules (may affect custom integrations)
- Updated Slack API usage (ensure your token has correct scopes)
- Modern reCAPTCHA (v2 - ensure your keys are compatible)
# Required
SLACK_SUBDOMAIN=your-slack-team # Your Slack workspace name
SLACK_API_TOKEN=xoxp-... # Slack API token (admin required)
GOOGLE_CAPTCHA_SECRET=... # reCAPTCHA secret key
GOOGLE_CAPTCHA_SITEKEY=... # reCAPTCHA site key
# Optional
PORT=3000 # Server port
HOSTNAME=0.0.0.0 # Bind hostname
SLACK_CHANNELS=general,random # Allowed channels
SLACK_INTERVAL=5000 # Polling interval (ms)
EMAIL_SLACK_LIST=user@domain.com # Restricted email list- Fork the repository
- Create a feature branch
- Make your changes
- Test with
npm test - Submit a pull request
MIT License - see LICENSE file for details
- Original slackin by @rauchg
- Modernization updates for 2025 compatibility
- Express.js, Socket.io, and Node.js communities
Ready to invite the world to your Slack? πβ¨