An easy way to Broadcast/Relay lichess games from a live url using heroku.
- Fork this repository on GitHub.
- Login/Sign up to heroku Create a new heroku app.
- Go to the
Deploytab in heroku and clickConnect to GitHub(Make sure your GitHub account is authorised to access heroku). - Click on
searchand select your fork of this repository. - Then
Enable Automatic Deploysand thenDeploy Branch. Make sure you choose themasterbranch to deploy. - Then go to the
Settingsin heroku and scroll down and click onReveal Config Varsand add the necessary Config Vars from here. - Now click on
Open appin heroku and save this link as you will need it soon for your broadcast. - Now go to Lichess and create a new broadcast. Add your Event Name, Description and all other required details for your broadcast. In the
Source URL, or game IDsfield in your broadcast add the link that you had saved when you clicked onOpen appin heroku. Now click onSUBMITin lichess and then clickCLICK TO CONNECTand your broadcast is now ready!!
Set the following environment variables ( Heroku Config Vars ) in heroku.
Do note that all the variables mentioned below are in the format key=value
RELAY_URL
Your PGN source url. For live broadcasts, you need the live PGN url.
TOKEN
Your Lichess API Access Token. This is required if you want to relay your ongoing games or live games.
MAX_GAMES
Maximum number of your ongoing games to relay ( default : 1 ).
BROADCAST_ID
Broadcast id of your Lichess Broadcast.
Start server with node server.js.
Endpoint / path will relay the games you specified in RELAY_URL.
If you provide your API access token, then endpoint /ongoing will relay your ongoing games. An attempt will be made to initialize ongoing games from RELAY_URL if it is set. If you provide a BROADCAST_ID, then your ongoing games will be pushed to your broadcast ( in this case TOKEN must have broadcast scopes ).