Quickstart Review
What happened in the Quickstart?
1. You setup your local environment
- Pulled down code
- Built project
- Set environment variables
2. Started a Server
npm start
spins up the HTTP server (localhost:3000
)
3. Experienced a Token Request Workflow
- User opens browser loads
index.html
. index.html
instructs browser to make a request to/auth
for a token.
4. Created tokens
/auth
uses@pulsebeam/server
SDK with your environment variables to generate tokens.
5. Started peers
index.html
uses@pulsebeam/peer
SDK with the token to create a peer and communicate with PulseBeam signaling servers.
6. Established a Peer-to-Peer Connection
- Second tab enters
peer-29
in the textbox and clicksConnect
. - The second browser initiates a connection to the first browser.
- PulseBeam establishes a connection established.
index.html
defines application logic: create data channel and sync text in real time
Diagram
Tips
Logs can be viewed from your console browser inspector.
PulseBeam will work globally within the scope of your project.
- Peers are not limited to two tabs within the same browser.
- You can establish a connection between peers on different networks or machines.
We can’t wait to see what you build on PulseBeam! Connect on Discord!
Bonus points
Experiment with the demo!
Explore PulseBeam CLI
Update frontend to work with PulseBeam CLI (https://pulsebeam.dev/docs/reference/cli/) instead of /auth
for token generation.
Hint:
One way is to create another input fortoken
, and add a peer.start()
button.