Sample apps
Three complete apps you can run on your own Cloudflare account in a few minutes: a classroom, a one-on-one telehealth visit and a webinar. Each is a small Cloudflare Worker that keeps your API key on the server and mints join tokens, plus a plain HTML and JavaScript page. There's no framework and no build step, so they're easy to read and change.
Deploy one
You need a free Appsocom Live account, a free Cloudflare account and Node.js.
- Create a project in the console and copy its API key.
- Download a sample below and unzip it.
- In the unzipped folder, deploy it and save your key and a code for hosts:
npm install
npx wrangler deploy # signs you in to Cloudflare the first time
npx wrangler secret put APPSOCOM_API_KEY # paste your API key
npx wrangler secret put TEACHER_CODE # telehealth: CLINICIAN_CODE, webinar: HOST_CODE- Open the
*.workers.devlink the deploy printed.
Classroom
A video class. Students join with the class link, and teachers join with the teacher code.
- Teachers can mute one student or everyone (and keep them muted), let a student present, remove someone and spotlight themselves.
- Raised hands, first raised first.
- Class chat, plus private messages between a student and the teacher.
- A waiting room and a class lock.
- Attendance as a CSV download, with first join, last leave and time in class for each student.
Built with roles and the classroom features.
Telehealth visit
Download the telehealth sample
A private one-on-one video visit. The clinician starts a visit with the clinician code and sends the patient a link.
- Every visit has its own random link and a waiting room. The clinician lets the patient in, or declines anyone else who has the link.
- The patient checks their camera before joining, and can join with voice only.
- Data saver turns video off and keeps the voice going on a weak connection.
- Chat and file sharing for photos and letters. Files are deleted when the visit ends.
- The clinician sees the patient's connection quality, and ending the visit ends it for everyone.
Built with the waiting room, data saver and file sharing.
The sample is a starting point, not a certified medical product. Before you use it with patients, add your own sign-in, consent and record keeping, and check the health data rules where you work.
Webinar
Hosts are on stage and everyone else watches. Hosts join with the host code.
- The audience joins view-only. Our servers enforce this, so a modified page can't put itself on stage.
- Q&A with upvotes and anonymous questions. Hosts mark questions answered.
- Live polls, with results hidden until the poll closes if the host wants.
- Emoji reactions and chat.
- The audience can raise a hand, and a host can bring them on stage and send them back.
Built with webinar tokens and engagement. On the free tier a room holds up to 10 people, and with credit up to 300. For a bigger audience, stream the webinar out to HLS, YouTube or Facebook.
Run one on your computer
cd appsocom-classroom # the unzipped sample (or appsocom-telehealth, appsocom-webinar)
npm install
cp .dev.vars.example .dev.vars # then put your API key and a code in it
npx wrangler dev # http://localhost:8787Open the page in two browser windows to try both sides.
Make it yours
- Sign-in. The host codes keep the samples simple. In your app, check who the user is in
src/index.jsand pick their role from your own data, as in Minting a token. - Room names. The samples turn the class, visit or event name into a room ID. Use your own IDs, such as a lesson or appointment ID.
- Look. Colours are at the top of
public/base.css. - A bundler. The pages load the browser SDK from
docs.appsocom.dev/sdk/through an import map. With a bundler,npm install @appsocom/clientand import it as usual. - Webhooks. Have your backend hear about joins and leaves with webhooks, for example to record when a visit started and ended.