Cloudflare Worker + D1

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.

The source is public. The Flutter client, Worker, migrations and technical documentation live in the public ClassSync repository ↗.

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:

Check the template before deploying. The repository's current 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

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.

One relay can serve multiple people. Each person creates a different private account and receives different Fireflies webhook values. A recovery code only joins that same person's additional devices.

Operational notes

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.