Quickstart (5 min)
What are we going to do?
Create real-time text editor between two peers.
- Account setup.
- Run a demo locally.
Let’s get started.
1. Your Account
Sign up for a PulseBeam account and get an api_key
and api_secret
.
- Go to pulsebeam.dev
- Create and account if you don’t have one
- Create a project, name your project
- Create a keypair on your project, give your keypair a name, e.g. demokey
- Store those keys!
2. Serve
Now that you’ve created your account and obtained your API credentials, let’s set up your local development environment.
You will need npm
and node.js
installed on your system. If you don’t have them, see installation instructions
3. See it
- Go to your browser open two tabs:
- URL for first tab: localhost:3000/?peerId=peer-29
- URL for second tab: http://localhost:3000/
- On the second tab enter peer-29 in the first text box. Then click connect.
- Type text in the bottom text box. Changes will synchronize between peers in real-time using WebRTC data channels.
Congratulations!
You’ve set up a real-time peer-to-peer connection using PulseBeam. Checkout ‘what happened’ in the next page. Explore the logs, experiment with the demo, and take the next step by using PulseBeam in your applications.
Troubleshooting
- Check your environment variables with
echo $PULSEBEAM_API_KEY && echo $PULSEBEAM_API_SECRET
- Port 3000 is already in use (
Error: listen EADDRINUSE: address already in use :::3000
) close other process or change port. - Something odd? Check you node version with
node -v
andnpm -v
. If older than 23.5.0 & 11.0.0 trynvm use node
ornvm use 23.5
- Something else? Checkout logs in browser console or contact us!