FreedeckRPC provides a simple interface to connect external applications to Freedeck, allowing you to send notifications, edit tiles in real-time, manage plugins, configure settings, and authenticate with the Freedeck server.
Features
- 🔔 Send notifications to Freedeck
- 🎛️ Edit tiles in real-time
- 🔌 Manage plugins
- ⚙️ Configure settings
- 🔐 Secure authentication with Freedeck server
Installation
Quick Start
1
Import the module
2
Identify your application
3
Connect to Freedeck
4
Listen for events and send notifications
API Reference
RPCClient
The main client object for interacting with Freedeck. All methods and properties are accessed through this object.
Methods
identify(appInfo)
identify(appInfo)
Identifies your application to the Freedeck server.Parameters:
appInfo(Object):id(string): Unique application ID (usegenerateID())title(string): Display name of your applicationauthor(string): Your name or organizationversion(string): Application versionauthorizationMessage(string): Message shown to user during authorization
connect(url, scopes)
connect(url, scopes)
Connects to a Freedeck server.Parameters:
url(string): Server URL (supportsfreedeck://protocol or standard HTTP)scopes(Array): Array of permission scopes (default:[RPCScopes.sendNotifications])
notify(...messages)
notify(...messages)
Sends a notification to Freedeck.Parameters:
...messages: Messages to send (will be joined with spaces)
on(event, callback)
on(event, callback)
Listens for events from the RPC client.Parameters:
event(string): Event namecallback(function): Event handler
status-update
Connection status changes
connection
Connection state updates
authorization
User authorization granted
reply
Server responses
generateAuthToken(appID)
generateAuthToken(appID)
Generates an authentication token for an application.Parameters:
appID(string): Application ID
validateAuthToken(token)
validateAuthToken(token)
Validates an authentication token format.Parameters:
token(string): Token to validate
Properties
RPCScopes
Permission scopes that define what your application can do with Freedeck.
number
default:1
Send notifications to Freedeck
number
default:10
Edit tiles without reloading
number
default:11
Edit tiles with reload
number
default:400
Edit Freedeck configuration
number
default:200
Add new plugins
number
default:201
Reload existing plugins
number
default:202
Disable plugins
number
default:203
Enable plugins
Connection States
1
disconnected
Initial state - not connected to any server
2
preflight
Preparing connection parameters and validation
3
initializing
Setting up Socket.IO connection to server
4
requesting-auth
Sending authorization request to server
5
prompting-user
User sees authorization dialog in Freedeck
6
connected@{url}
Successfully connected and authorized
7
denied
User rejected authorization (app exits automatically)
Error Handling
Advanced Usage
Custom Logging
Handoff API
For alternative communication when direct RPC isn’t available:Examples
Simple Notification App
Status Monitor
Troubleshooting
Common Issues
- Connection fails: Ensure Freedeck is running on the specified URL
- Authorization denied: User must click “Allow” in the Freedeck authorization dialog
- Notifications not appearing: Make sure you have
sendNotificationsscope and are authorized
Debug Mode
Requirements
- Node.js
- socket.io-client package
- Running Freedeck application
- Network access to Freedeck server