Skip to content

dougdevitre/jta-slack-bot

Repository files navigation

JTA Slack Bot — Vercel Edition

Architecture

Member in Slack
    → @mention or /jta command
    → Vercel Serverless Function (POST /slack/events)
        ├── Vercel KV (conversation history, 7-day TTL)
        └── Anthropic API (Claude, jta-platform skill embedded)
    → Response posted to Slack thread

Step 1 — Create the Slack App

  1. Go to https://api.slack.com/appsCreate New AppFrom a manifest
  2. Select your JTA workspace
  3. Paste the contents of slack-app-manifest.yml
  4. Click CreateInstall to Workspace
  5. Copy from OAuth & Permissions:
    • Bot User OAuth Token (xoxb-...)
  6. Copy from Basic Information → App Credentials:
    • Signing Secret

Step 2 — Deploy to Vercel

Option A: One-click deploy

Deploy with Vercel

Option B: CLI deploy

# Install Vercel CLI
npm i -g vercel

# From project root
vercel

# Link a Vercel KV store (for conversation history)
vercel kv create jta-conversations

# Set environment variables
vercel env add SLACK_BOT_TOKEN
vercel env add SLACK_SIGNING_SECRET
vercel env add ANTHROPIC_API_KEY
vercel env add ADMIN_CHANNEL_ID

# Deploy to production
vercel --prod

Step 3 — Connect Slack to Vercel

  1. After deploying, note your Vercel URL (e.g., https://jta-slack-bot.vercel.app)
  2. In your Slack app settings → Event Subscriptions:
    • Enable events → paste https://YOUR_VERCEL_URL/slack/events
    • Slack will send a challenge request; the function will return the challenge
  3. In Slash Commands/jta → update the Request URL to https://YOUR_VERCEL_URL/slack/events
  4. Reinstall the app to your workspace after any permission changes

Step 4 — Invite Bot to Channels

/invite @JTA Assistant

Invite to:

  • #jta-member-hub (or wherever members chat)
  • Your admin channel (set the ADMIN_CHANNEL_ID env var to this channel's ID)

Usage Examples

Member

@JTA Assistant what are my membership benefits?
@JTA Assistant I need grant language for a Ford Foundation proposal
@JTA Assistant how do I get JTA to amplify our product launch?

/jta benefits
/jta grant
/jta amplify We just closed our Series A — help us announce it through JTA
/jta events
/jta volunteer
/jta spotlight

Admin (staff channel only — full SOP context)

@JTA Assistant draft an at-risk email for a member who hasn't engaged in 4 months
@JTA Assistant give me the event ops checklist for a virtual forum next week
@JTA Assistant write a sponsorship proposal intro for Paladin Legal at the $7,500 tier

Environment Variables

Variable Required Description
SLACK_BOT_TOKEN Yes Bot User OAuth Token (xoxb-...)
SLACK_SIGNING_SECRET Yes From Slack app Basic Information
ANTHROPIC_API_KEY Yes Anthropic API key (sk-ant-...)
ADMIN_CHANNEL_ID No Channel ID for admin-only commands
KV_REST_API_URL Auto Set automatically when you link Vercel KV
KV_REST_API_TOKEN Auto Set automatically when you link Vercel KV

Local Development

# Copy env template
cp .env.example .env.local

# Fill in your values in .env.local

# Install dependencies
npm install

# Run locally with Vercel dev server
npx vercel dev

# Or run the smoke test (Claude API only, no Slack)
node scripts/test-local.js

Cost Estimate (JTA scale)

Service Assumption Monthly Cost
Vercel (Hobby) Serverless functions $0
Vercel KV (Hobby) 3K commands/day, 256MB $0
Anthropic API claude-sonnet-4-6, ~500 msgs × 1.5K tokens ~$3.75
Total ~$4/month

File Tree

jta-slack-bot/
├── package.json
├── vercel.json                    ← route config
├── slack-app-manifest.yml         ← paste into api.slack.com
├── .env.example                   ← env var template
├── api/
│   └── slack/
│       └── events.js              ← Vercel serverless function (single endpoint)
├── src/
│   ├── system-prompt.js           ← jta-platform skill context (member + admin)
│   ├── claude.js                  ← Anthropic API wrapper
│   ├── history.js                 ← Vercel KV conversation history
│   ├── commands.js                ← /jta slash command router
│   └── secrets.js                 ← Environment variable loader
└── scripts/
    └── test-local.js              ← Local smoke test

⚠️ Disclaimer

This project is provided for informational and educational purposes only and does not constitute legal advice, legal representation, or an attorney-client relationship. No warranty is made regarding accuracy, completeness, or fitness for any particular legal matter. Always consult a licensed attorney in your jurisdiction before making legal decisions. Use of this software does not create any professional-client relationship.


Built by Doug Devitre

I build AI-powered platforms that solve real problems. I also speak about it.

CoTrackPro · admin@cotrackpro.com

Hire me: AI platform development · Strategic consulting · Keynote speaking

AWS AI/Cloud/Dev Certified · UX Certified (NNg) · Certified Speaking Professional (NSA) Author of Screen to Screen Selling (McGraw Hill) · 100,000+ professionals trained

About

JTA Slack Bot — Claude-powered member assistant for the Job Training Alliance, hosted on Vercel with AI-driven workforce guidance.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors