Pipelab SDK Integration (soon)
Overview
The Pipelab SDK provides powerful tools for integrating with applications. This section covers how to set up and use the SDK in your applications. For detailed API reference, see the official Pipelab SDK documentation.
SDK Versioning
The Pipelab SDK follows semantic versioning. We recommend using a specific version range in your package.json to ensure compatibility:
"dependencies": {
"@pipelab/core": "^1.2.0"
}
Setup Instructions
Install the Pipelab SDK package:
bashnpm install @pipelab/core
Import the SDK in your Electron main process:
javascriptconst { PipelabSDK } = require('@pipelab/core');
Initialize the SDK in your main process:
javascriptconst sdk = new PipelabSDK();
Using Pipelab SDK
The SDK is intended to run in a browser environment because it commmunicate with a WebSocket server running in the main process.
Basic Usage Example
// TODO
SDK Compatibility
The Pipelab SDK works with any wrapper that supports Node.js or has a JavaScript runtime:
- Tauri (with Node.js integration)
- NW.js
- Neutralino.js
More languages will be supported in the future.
Raw API
If you need to use the raw API, you can use the following code:
// Create WebSocket connection
const ws = new WebSocket('ws://localhost:31753');
ws.onopen = () => {
console.log('Connected to WebSocket server');
// Send achievement activation request
ws.send(JSON.stringify({
url: '/steam/raw',
body: {
namespace: 'achievements', // Steamworks namespace
method: 'activate', // Method to call
args: ['YOUR_ACHIEVEMENT_ID'] // Achievement ID as an array
}
}));
};
// Handle incoming messages
ws.onmessage = (event) => {
const response = JSON.parse(event.data);
console.log('Server response:', response);
};
// Error handling
ws.onerror = (error) => console.error('WebSocket error:', error);
ws.onclose = () => console.log('Connection closed');
You can find the format of the orders to send in this messages file.