Collaborative Whiteboard (Deprecated)
This implementation of collaborative whiteboard using Pusher has been deprecated in favor of using 100ms' own messaging infrastructure. Check the new whiteboard documentation to know more.
Overview
This guide will walk you through instructions to build a Collaborative whiteboard by integrating Pusher with our sample app.
You need three components to complete the Collaborative whiteboard setup:
- Pusher Channels app
- Whiteboard server — this guide follows Vercel deployment.
- Whiteboard client — this guide uses the 100ms-web sample app.
Pusher Channels App
- Sign up for a Pusher account.
- Click on
Create appto create a newChannels app. - Provide a friendly
name for your appandselect a clusterbased on your preference. - Go to the
App Keyssection on the sidebar, and copy your app_id, key, secret, and cluster. - Go to the
App Settingssection on the sidebar and turn onenable client events.
Whiteboard Server
- Fork the Whiteboard Pusher server and deploy it using your preferred hosting provider.
- Add the Pusher keys noted earlier to environment variables.
APP_ID="app_id" APP_KEY="key" APP_SECRET="secret" APP_CLUSTER="cluster"
- The API path is
api/pusher/auth; say your deployment URL iswhiteboard-server.vercel.app, then the Pusher Auth Endpoint will behttps://whiteboard-server.vercel.app/api/pusher/auth.
Whiteboard Client
- From the 100ms-web sample app repository, copy the whole folder at
/src/plugins/whiteboardinto your live video conferencing or live streaming apps using 100ms' SDKs. - Add the pusher app key, auth endpoint and cluster to
REACT_APP_PUSHER_APP_KEY,REACT_APP_PUSHER_AUTHENDPOINT,REACT_APP_PUSHER_CLUSTERenvironment variables. - The
useWhiteboardMetadatahook returns a state such as the whiteboard owner(whiteboardOwner) and action to toggle the whiteboard(toggleWhiteboard). Refer to usage inToggleWhiteboard.jsx- an icon button to toggle the whiteboard based on the active state. - When the whiteboard is active(
whiteboardOwnerfromuseWhiteboardMetadatais not null), render theWhiteboardcomponent on your UI to let your users draw on the whiteboard. RefermainView.jsxandWhiteboardView.jsx.
Have a suggestion? Recommend changes ->



