Run your own ClassSync relay.
The relay is deliberately small. It receives signed Fireflies webhook metadata, coordinates private accounts and devices, and stores encrypted account-sync payloads — not lecture transcripts or summaries.
1. Clone, install and authenticate
git clone https://github.com/hugo2006alm/classsync.git
cd classsync/apps/relay
pnpm install
pnpm exec wrangler login
2. Create the D1 database
pnpm exec wrangler d1 create classsync-relay
Paste the returned database_id into wrangler.jsonc, then apply all repository migrations:
pnpm run db:migrate:remote
3. Choose the account registration mode
The relay supports three account-creation policies through ACCOUNT_REGISTRATION_MODE:
open: anyone who can reach the relay can create a new private ClassSync account; no registration code is required.invite: account creation requires a single-useCSINV-...invite generated by the operator.token: account creation requires a shared registration token.
wrangler.jsonc explicitly sets ACCOUNT_REGISTRATION_MODE to open. Change it to invite or token if you do not want public account registration on your relay.If the variable is omitted entirely, the Worker falls back to token mode. ClassSync discovers the selected policy during setup and only asks the user for a code when the relay requires one.
4. Set relay secrets
Wrangler stores these values outside the repository:
pnpm exec wrangler secret put FIREFLIES_WEBHOOK_SECRET
pnpm exec wrangler secret put DEVICE_API_TOKEN
pnpm exec wrangler secret put FIREBASE_SERVICE_ACCOUNT_JSON
FIREFLIES_WEBHOOK_SECRET: legacy/global Fireflies signing secret used by compatibility endpoints.DEVICE_API_TOKEN: legacy device-enrolment credential and backwards-compatible registration/admin fallback. Keep it long and private.FIREBASE_SERVICE_ACCOUNT_JSON: Firebase service-account JSON used for the Android FCM fast path.
For a dedicated token-registration secret instead of the legacy fallback, also set:
pnpm exec wrangler secret put ACCOUNT_REGISTRATION_TOKEN
For invite mode, protect operator invite creation with a separate admin secret:
pnpm exec wrangler secret put RELAY_ADMIN_TOKEN
5. Deploy
pnpm run deploy
Copy the resulting HTTPS Worker URL. On ClassSync's Relay screen, expand the custom-relay option and enter that URL. The app reads the relay's registration policy and prompts for an invite or token only when required.
6. Create the ClassSync account and Fireflies webhook
After registration, the Account screen creates a private account and gives the user a recovery code. The Fireflies step then shows that account's Webhooks V2 URL and 32-character signing secret. Configure those exact values in Fireflies and subscribe only to meeting.transcribed.
Operational notes
- Apply new D1 migrations before clients rely on the corresponding relay behavior.
- Changing Worker code, secrets or migrations does not normally change the Worker URL.
- Protect public endpoints with Cloudflare rate limiting appropriate to your deployment.
- FCM is a fast path; polling remains the recovery path when push delivery is unavailable.
- Do not put relay secrets, account recovery codes or Fireflies signing secrets into Git, screenshots or issue reports.
- The relay stores no transcript, prompt, generated summary or Notion page content.
Keep the relay and client compatible
Before upgrading a self-hosted client fleet, review the public repository's relay and migration notes. Client releases do not automatically deploy your Worker or apply D1 migrations.