Skip to content

Freedeck/rpc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freedeck RPC

Freedeck now (6.0.0-ob7+) has special Socket.IO endpoints that let you control Freedeck (alongside its Handoff API).

Using RPC as an App

Pre-steps

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.
  1. When you connect to the socket.io server (on port 5754), you MUST send a RPC.Authorize event 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.

  1. 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! 
}

About

Official JS RPC library for Freedeck.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published