Consolidate webhooks repo into virtualcoffee.io#1501
Merged
Conversation
Adds @netlify/functions, @slack/bolt, slackify-html, dotenv, and @types/slackify-html to support the consolidated webhook functions. Adds scripts/build-rooms.ts to generate data/rooms.json from Airtable during prebuild, and chains it into the existing prebuild pipeline.
Consolidates the Netlify Functions previously hosted in the standalone
webhooks repo (typescript-migration branch) into this codebase:
- slack/: unified Slack Events API + interactivity handler with custom
Bolt receiver, signature verification, and team_join welcome flow.
- zoom-meeting-webhook-handler/: handles meeting.{started,ended,
participant_joined,participant_left}, syncing co-working room state
to Slack threads and Airtable room_instances records.
- event-reminders-{daily,hourly,weekly}/: scheduled functions that pull
upcoming events from the CMS GraphQL API and post Block Kit messages
to Slack. Schedules declared in-function via export const config.
- _shared/: HMAC verification helpers, Slack Web client wrapper,
requireEnv helper, and CMS/Room types reused across functions.
- netlify/env.d.ts: typed ProcessEnv declarations for the new vars.
Replaces the CommonJS handler-style functions with TypeScript Netlify Functions v2 (default-exported (req: Request) => Response). Aligns with the rest of the netlify/functions/ directory now that the webhook functions have landed. The /join-coffee and /join-slack redirects in netlify.toml continue to work unchanged.
Adds [functions] included_files = ["data/*.json"] so the Zoom handler can bundle the generated rooms.json. Adds /zoom-meeting-webhook-handler, /slack-events, and /slack-interactivity rewrites pointing at the corresponding functions, replacing the routing previously handled by the standalone webhooks site.
Adds a Webhooks section to README.md summarizing the HTTP endpoints, scheduled functions, and the rooms prebuild step. Documents the new Slack/Zoom/Airtable env vars in .env.example. Carries over the co-working-bot-ideation design doc from the previous webhooks repo.
Remove the co-working-bot ideation doc (and its README link) since the design was never built. Add a pretypecheck script so tsc finds data/rooms.json on a clean clone.
👷 Deploy Preview for virtual-coffee-io processing.
|
BekahHW
reviewed
May 14, 2026
BekahHW
reviewed
May 14, 2026
Member
|
@JoeKarow I just bumped a couple of packages to removed the next.js vulnerabilities. You'll need to update the package.json. |
Signed-off-by: Joe Karow <58997957+JoeKarow@users.noreply.github.com>
Signed-off-by: Joe Karow <58997957+JoeKarow@users.noreply.github.com>
Signed-off-by: Joe Karow <58997957+JoeKarow@users.noreply.github.com>
meg-gutshall
approved these changes
May 16, 2026
Contributor
meg-gutshall
left a comment
There was a problem hiding this comment.
LGTM! I would merge it, but I saw the note about the env variables that need to be added in Netlify. I'll hold off to make sure all our ducks are in a row first.
Member
Author
env vars have been added to Netlify. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked Issue
No tracking issue; this lands the consolidation discussed alongside webhooks PR Virtual-Coffee/webhooks#28.
Description
This PR folds the standalone
Virtual-Coffee/webhooksNetlify site intovirtualcoffee.ioso we maintain one repo, one deploy, and one set of secrets.What's moving in
webhooks/typescript-migration:/zoom-meeting-webhook-handler→netlify/functions/zoom-meeting-webhook-handler/{index,airtable,slack}.ts/slack-eventsand/slack-interactivity→netlify/functions/slack/{index,messages}.ts(a single function backs both routes)export const config: Config = { schedule: '…' }):event-reminders-daily(0 12 * * *)event-reminders-hourly(50 * * * *)event-reminders-weekly(0 12 * * 1)netlify/functions/_shared/{env,slack,verify,types/*}.ts(the_shared/prefix prevents Netlify from treating those folders as deployable functions).scripts/build-rooms.tsprebuild step that pulls co-working room records from Airtable intodata/rooms.json. Wired intoprebuildandpretypecheck. Writes an empty[](with a warning) ifAIRTABLE_COWORKING_BASEis not set, so contributors without webhook secrets can still build/typecheck locally.What changed in-repo
netlify/functions/join-{coffee,slack}.jsto TS Functions v2 with default-exported(req: Request) => Response. Behavior preserved; missing env vars now throw via a sharedrequireEnvhelper instead of silently 302-ing toLocation: undefined.netlify.toml: added[functions] included_files = ["data/*.json"]and three new redirects (/zoom-meeting-webhook-handler,/slack-events,/slack-interactivity). Existing/join-coffeeand/join-slackredirects are unchanged — they target function names, so the JS→TS migration is transparent.package.json: added@netlify/functions,@slack/bolt,slackify-html, plus@types/slackify-html/dotenvdev deps. Wiredpnpm build-roomsintoprebuildandpretypecheck.netlify/env.d.ts: typedprocess.envfor all webhook variables (CMS_*,SLACK_*,ZOOM_*,AIRTABLE_COWORKING_BASE, plus the existingZOOM_TUESDAYS/THURSDAYS/SLACK_JOIN_LINKused by the migrated JS functions)..env.exampleandREADME.md: documented the new env vars and a "Webhooks" section summarizing each endpoint and scheduled function.Out of scope / follow-ups
webhookshost and will continue working through whatever DNS/redirect the maintainers set up at cutover. Updating Slack app + Zoom marketplace settings to hitvirtualcoffee.io/...directly is a follow-up, not a blocker.Virtual-Coffee/webhooksand stop the old Netlify site.Methodology
Two repos for one project's webhooks meant duplicate dependencies, duplicate Netlify config, duplicate env-var management, and two places to reason about the Slack/Zoom contract surface. The
webhooksrepo'stypescript-migrationbranch had finished modernizing it (TS, Functions v2, ESM, pnpm) into the same stackvirtualcoffee.ioalready uses, so consolidation was a clean port rather than a rewrite.Concrete choices worth flagging:
webhooks/rather than preserving its git history, because the v1→v2 refactor on that branch contains files (functions/slack-{events,interactivity}/) that no longer exist and would need to be reverted post-merge. A clean port keeps this PR's diff readable._shared/directory naming. Netlify treats every direct subdirectory ofnetlify/functions/as a deployable function. Prefixing with_shared/is the documented opt-out and keeps shared code co-located with the functions that import it.requireEnvforjoin-coffee/join-slackenv vars. Strictly stricter than the legacy JS — missing config now produces a 500 instead of a 302 toLocation: undefined. Prod has these set; this only changes behavior in misconfigured environments, where loud failure is what we want.build-rooms.tswrites[]on missing creds. Letspnpm install && pnpm buildsucceed for contributors without webhook secrets. The Zoom handler then matches no rooms, which is the correct behavior in that environment anyway.export const config: Config = { schedule: '…' }per Netlify Functions v2 — no separate cron config needed. The stale/event-reminders → event-reminders-backgroundredirect from the oldnetlify.tomlwas dropped (the function it referenced no longer exists; scheduled functions don't need an HTTP route).Before merge: copy the webhook env vars from the old
webhooksNetlify site to thevirtualcoffee.iosite (CMS_URL,CMS_TOKEN,SLACK_BOT_TOKEN,SLACK_SIGNING_SECRET,SLACK_ANNOUNCEMENTS_CHANNEL,SLACK_EVENT_ADMIN_CHANNEL,ZOOM_WEBHOOK_SECRET_TOKEN,ZOOM_WEBHOOK_AUTH,AIRTABLE_COWORKING_BASE).Code of Conduct