
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@deskthing/server
Advanced tools
The DeskThing-App Server is an essential module for setting up your DeskThing App. It provides the server-side communication layer for your app.
Deskthing-Server is intended to work alongside DeskThing-Client to allow communication back-and-forth with the client. DeskThing-Server holds all the information and functions the server/ side of your app needs.
To install the server, use the following command:
npm install deskthing-server
To use the DeskThing server in your application, you need to import it and get an instance:
import DeskThing from 'deskthing-server';
const deskThing = DeskThing.getInstance();
You can send messages to the client using the sendDataToClient method. For example, to send a JSON object to the client:
deskThing.sendDataToClient({type: 'message', payload: 'Hello, Client!'});
To handle incoming messages from the client, you need to set up event listeners:
deskThing.on('data', (data) => {
console.log('Received data:', data);
});
Here is a more complete example demonstrating two-way communication between the server and client:
import DeskThing from 'deskthing-server';
const deskThing = DeskThing.getInstance();
// Sending a message to the client
deskThing.sendDataToClient({ type: 'message', payload: 'Hello, Client!'});
// Listening for a response from the client
deskThing.on('data', (data) => {
console.log('Received data from client:', data.payload); // will print "someResponse" in this example
});
deskThing.on('set', (data) => {
console.log('Received data from client:', data.payload.key); // will print 'value' in this example
});
import DeskThing from 'deskthing-client';
const deskThing = DeskThing.getInstance();
// Sending a message to the server
deskThing.sendMessageToServer({ type: 'set', payload: { key: 'value' } });
// Listening for a response from the server
deskThing.on('message', (data) => {
console.log('Received response from server:', data); // logs 'Hello, Client!'
deskThing.sendMessageToServer({type: 'data', payload: 'someResponse'})
});
You can route requests to another app running on the server:
deskThing.sendDataToOtherApp('appId', { type: 'set', payload: { key: 'value' } });
To fetch persistent data from the server:
const data = await deskThing.getData();
console.log('Fetched data:', data);
To manage settings:
const settings = await deskThing.getSettings();
console.log('Current settings:', settings);
To add a background task:
const taskLoop = () => {
// Your background task code
return true;
};
deskThing.addBackgroundTaskLoop(taskLoop);
You can find more information in https://github.com/itsriprod/deskthing-app-client
FAQs
The Deskthing connector for the server apps
We found that @deskthing/server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.