Freedeck now (6.0.0-ob7+) has special Socket.IO endpoints that let you control Freedeck (alongside its Handoff API).
Make sure you have an app ID & title.
If you don't want to use the built-in ID generator:
- Get the current UNIX time
- Turn it into a base16 string
- Append ".(App TITLE).(App Author).fdrpc"
- It should now look something like "1917274d275.MyApp.My Name.fdrpc"
- Encode it with Base64
- This is what your ID should look like: "MTkxNzI3NGQyNzUuTXlBcHAuTXkgTmFtZS5mZHJwYw=="
- If you want your app to be put on the official RPC Integration list (coming soon), your app must use this ID format.
- When you connect to the socket.io server (on port 5754), you MUST send a
RPC.Authorizeevent with this data:
{
rpc: true,
appInformation: {
title: "My Cool App",
id: "My cool ID" // This can be generated with RPCClient.generateID(title, author)
},
scopes: [
1 // I'll go over scopes in a later section.
],
nonce: "Anything" // A nonce is a one-time-use token that is used so you know what event was replied to.
}If you do not send this request, you will not be treated as an RPC App, thus all requests will be ignored.
- You MUST listen for
RPC.Reply. A typical output looks like this:
{
id: "My cool ID", // this should always correspond with your app's id.
value: "Value", // which is always a string.
nonce: "Anything!" // which is always your input nonce, so you know what event was replied to!
}