
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
@sonicus-sdk/core
Advanced tools
⚠️ BETA VERSION - APIs are subject to change without notice. Use with caution.
⚠️ BETA VERSION - USE WITH CAUTION ⚠️
This package is currently in beta. All APIs are subject to change without notice. Breaking changes may occur in any release until version 1.0.0.
@sonicus-sdk/core is a real-time communication SDK that provides WebSocket-based functionality for:
npm install @sonicus-sdk/core@beta
import { SonicusClient } from '@sonicus-sdk/core';
// Define your presence status type
type UserPresence = {
status: 'online' | 'offline' | 'away';
timestamp: string;
};
// Create a WebSocket handler
const wsHandler = {
onMessage: (message) => {
console.log('Received message:', message);
},
onError: (event) => {
console.error('WebSocket error:', event);
},
onClose: (event) => {
console.log('WebSocket closed:', event);
},
onOpen: (event) => {
console.log('WebSocket connected:', event);
},
};
// Initialize the client
const client = new SonicusClient<UserPresence>({
authUrl: '/api/sonicus/jwt/issue',
wsUrl: 'wss://sonicus-platform.fly.dev',
}, wsHandler);
// Initialize the connection
await client.init();
interface SonicusConfig {
authUrl?: string; // Default: '/api/sonicus/jwt/issue'
refreshUrl?: string; // Default: '/api/sonicus/jwt/refresh'
authMethod?: 'GET' | 'POST' | 'PUT';
headers?: Record<string, string>;
wsUrl?: string; // Default: 'wss://sonicus-platform.fly.dev'
reconnectInterval?: number; // Default: 5000ms
maxReconnectAttempts?: number; // Default: 5
defaultPresenceStatus?: T; // Custom presence status type
}
The client maintains the following connection states:
connecting
: Initial connection attemptconnected
: Successfully connecteddisconnected
: Not connectedreconnecting
: Attempting to reconnect after disconnectionDocumentation is subject to change. Please refer to the latest version for the most up-to-date information.
While this package is in beta, we welcome feedback and bug reports. Please open an issue if you encounter any problems.
[License information will be added before final release]
FAQs
⚠️ BETA VERSION - APIs are subject to change without notice. Use with caution.
The npm package @sonicus-sdk/core receives a total of 6 weekly downloads. As such, @sonicus-sdk/core popularity was classified as not popular.
We found that @sonicus-sdk/core 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.