@privitty/privitty-core
v0.3.12
Published
Privitty Core - Native binary wrapper for JSON-RPC server
Maintainers
Readme
@privitty/privitty-core
Native binary wrapper for Privitty Core - JSON-RPC server for secure file encryption and access control.
Installation
npm install @privitty/privitty-coreThe package automatically installs the correct platform-specific binary for your system.
Supported Platforms
- macOS: darwin-arm64, darwin-x64
- Windows: win32-x64
- Linux: linux-x64
Usage
Getting the Binary Path
const { getBinaryPath } = require('@privitty/privitty-core');
const binaryPath = getBinaryPath();
console.log('Privitty binary:', binaryPath);Spawning the JSON-RPC Server
const { spawn } = require('child_process');
const { getBinaryPath } = require('@privitty/privitty-core');
const binaryPath = getBinaryPath();
const serverProcess = spawn(binaryPath, {
env: {
// Your environment variables
},
});
// Handle JSON-RPC over stdio
serverProcess.stdout.on('data', (data) => {
const response = JSON.parse(data.toString());
console.log('Response:', response);
});
serverProcess.stdin.write(JSON.stringify({
jsonrpc: '2.0',
method: 'switchProfile',
params: { username: 'alice', user_email: '[email protected]', user_id: '1' },
id: 1
}) + '\n');Integration with Electron
See client.ts example for a complete Electron integration.
Platform Information
const { getPlatformInfo } = require('@privitty/privitty-core');
const info = getPlatformInfo();
console.log(info);
// {
// platform: 'darwin',
// arch: 'arm64',
// binaryPath: '/path/to/binary'
// }Architecture
This is a meta-package that depends on platform-specific packages:
@privitty/privitty-core-darwin-arm64- macOS Apple Silicon@privitty/privitty-core-darwin-x64- macOS Intel@privitty/privitty-core-linux-x64- Linux x86_64@privitty/privitty-core-win32-x64- Windows 64-bit
npm automatically installs only the package for your current platform.
JSON-RPC API
The binary communicates via JSON-RPC 2.0 over stdio. Available methods:
switchProfile- Switch user profilegetSystemState- Get system stategetHealth- Health checkinitCreateGroup- Create a groupinitAddMemberToGroup- Add member to groupprocessFileEncryptRequest- Encrypt fileprocessFileDecryptRequest- Decrypt fileprocessGroupFileEncryptRequest- Encrypt group fileprocessGroupFileDecryptRequest- Decrypt group file- And more...
See platform-specific API documentation for complete details.
Version
This package version is independent of the native binary version. Check the binary version:
./privitty-server --versionLicense
Proprietary - Alanring Technologies Private Limited
Support
For issues and questions, contact Alanring Technologies Private Limited.
