intersvyaz
v2.3.0
Published
Node.js SDK for the Intersvyaz smart home API — intercoms, cameras, IPTV, balance, and SIP calls
Maintainers
Readme
intersvyaz
[RU] | [EN]
A Node.js library for interacting with the Intersvyaz smart home API.
It provides programmatic access to intercom control, camera feeds, IPTV channels, balance information, and event history.
Migration
Upgrading from v1? Check the Migration Guide for
details on breaking changes (new constructor, removed format parameter) and
new features.
Installation
npm install intersvyazUsage
import Intersvyaz from 'intersvyaz';
const client = new Intersvyaz({
credentials: {
username: 'user',
password: 'pass'
},
logLevel: 'error'
});
// Get balance
const balance = await client.getBalance();
console.log(`Balance: ${balance.balance}`);
// List intercoms
const relays = await client.getDomofon();
console.log(`Intercoms: ${relays.length}`);Configuration
The constructor accepts a config object with the following properties:
| Property | Description |
| --- | --- |
| credentials | Object containing authentication details. |
| logLevel | Logging level: none, error, warn, info, debug. |
| localIp | Force a specific local IP for SIP (useful in Docker/NAT). |
Credentials Object
| Property | Description |
| --- | --- |
| username | Account username. |
| password | Account password. |
| accessToken | Cached mobile API token (optional). |
| atExpiredTime | Token expiration timestamp in ms (optional). |
| lkToken | Cached CRM token (optional). |
| ltExpiredTime | CRM token expiration timestamp in ms (optional). |
| sip | Full SIP URI string (optional). |
API
User & Account
getServiceStatus()Returns service status information.getUser()Returns user profile (name, account number, roles).getAddress()Returns address IDs (flat, building, street, city).getBalance()Returns balance, debt, and next payment information. Numeric fields are automatically parsed as floats.
Intercom
getDomofon(relayId?)Returns all intercoms, or a specific one ifrelayIdis provided.openDomofon(relayId)Opens the door for the specified relay.getCameras(entranceUid)Returns camera info (snapshots, HLS streams, archive parameters) for the given entrance UUID.
IPTV
getTvChannels(options?)Returns a list of IPTV channels with HLS stream URLs. Options:channelId,topicId.getTvPrograms(options?, channels?)Returns TV program guide. Supports chunked loading for large channel lists. Options:channelId,hours,beginDate,endDate.
History
getHistory(options?)Returns event history (door opens, calls) with pagination. Options:from,to,page,perPage.
Lifecycle
dispose()Stops the SIP stack and releases resources. Safe to call even if SIP was never started.
Events
| Event | Description |
| --- | --- |
| auth | Emitted when tokens are refreshed. Payload: credentials object. |
| call | Emitted on incoming SIP call. Payload: parsed invite data. |
