Client libraries for ioBroker using web sockets
npm install @iobroker/socket-clientThis library encapsulates the API from ioBroker backend to frontend.
There are 2 connection types in it:
- Connection => for all Web Frontends;
- AdminConnection => for Admin UI Connections, these have access to more commands.
npm run build for one-time builds.npm run watch for continuous builds.
Include the socket library from Admin or Web adapter:
``html`
Instantiate the connection:
`js
const adminConnection = new AdminConnection({
protocol: 'ws',
host: '192.168.1.2',
port: 8081,
admin5only: false,
autoSubscribes: [],
// optional: other options
});
await adminConnection.startSocket();
await adminConnection.waitForFirstConnection();
// and use it
console.log(await adminConnection.getHosts());
`
- (@GermanBluefox) Updated packages, e.g. TypeScript 5.9
- (@GermanBluefox) Added new method: getObjectViewSystemCached
- (@GermanBluefox) Allowed using of this library in Node.js
- (@GermanBluefox) Added debug information
- (@GermanBluefox) Corrected redirect by login
- (@GermanBluefox) Updated packages. TypeScript 5.8
- (@GermanBluefox) Added support for OAuth2 authentication
- (@GermanBluefox) Updated js-controller 7 packages
- (@GermanBluefox) Prevented small possible error by subscribeStates
- (@GermanBluefox) Added the log message type
- (@GermanBluefox) Changed behavior by timeout: do not cache such responses
namespace iob$3
- (@GermanBluefox) Migrated to eslint@9
- (@GermanBluefox) Breaking change: all thrown errors are now instances of Error class$3
- (@GermanBluefox) made protocol and host optional
$3
- (@GermanBluefox) Corrected typing of
CompactInstanceInfo$3
- (@GermanBluefox) Corrected typing of cmdExec
$3
- (@GermanBluefox) Corrected upgradeController
$3
- (@GermanBluefox) Added admin functions: upgradeAdapterWithWebserver, upgradeController, upgradeOsPackages, updateLicenses
$3
- (@GermanBluefox) Better typing for subscribeOnInstance
$3
- (@GermanBluefox) Added source files for typescript
$3
- (@GermanBluefox) Replaced the SystemConfig type with ioBroker.SystemConfigObject
$3
- (@GermanBluefox) Allowed calling getObjectView, getObjectViewSystem and getObjectViewCustom without options
$3
- (@GermanBluefox) Improved getNotifications command
$3
- (@GermanBluefox) Corrected the object subscribing
$3
- (@GermanBluefox) Corrected types
$3
- (@GermanBluefox) Allowed subscribing and unsubscribing on arrays of IDs
$3
- (@GermanBluefox) Changed systemLang to writable, as it can be changed on the fly
$3
- (foxriver76) fix
cjs types export
- (@GermanBluefox) Better typing for getLogs$3
- (@GermanBluefox) Better typing for getNotifications
$3
- (@GermanBluefox) updated packages
$3
- (foxriver76) port to
@iobroker/types$3
- (foxriver76) improve performance on
subscribeState without wildcard$3
- (@GermanBluefox) Added return value for
subscribeOnInstance$3
- (foxriver76) Corrected import of modules
$3
- (@GermanBluefox) Added implicit export of AdminConnection
$3
- (jogibear9988) Updated Connection api documentation
$3
- (@GermanBluefox) Added
subscribeStateAsync method for legacy compatibility$3
- (@GermanBluefox) Added the subscribing on the specific instance messages
$3
- (@GermanBluefox) Update packages
$3
- (@GermanBluefox) added new method -
getObjectsById$3
- (rovo89) Typescript types tuning
- (@GermanBluefox) The path was removed from
socket.io URL$3
- (@GermanBluefox) better detection of chained certificates
$3
- (@GermanBluefox) packages updated
$3
- (@GermanBluefox) Added
rename and renameFile methods$3
- (@GermanBluefox) Made the fix for
material and echarts$3
- (@GermanBluefox) Caught errors on state/object changes
- (@GermanBluefox) Special changes for vis and "nothing_selected" ID
$3
- (@GermanBluefox) Added
log command$3
- (jogibear9988) Added getObjectViewSystem and getObjectViewCustom and deprecated getObjectView
$3
- (@GermanBluefox) Added support of authentication token
$3
- (@GermanBluefox) Working on cloud connection
$3
- (@GermanBluefox) Added method getCompactSystemRepositories
$3
- (@GermanBluefox) Added ack parameter to
setState method.$3
- (@GermanBluefox) Allowed call of getStates with pattern
$3
- (@GermanBluefox) Errors on connection are handled now
$3
- (@GermanBluefox) Added preparations for iobroker cloud
$3
- (@GermanBluefox) Added functions to reset cache
$3
- (@GermanBluefox) Allowed connections behind reverse proxy
$3
- (@GermanBluefox) Added functions to reset cache
$3
- (@GermanBluefox) Corrected the cache problem by
getInstalled and getRepository commands$3
- (@GermanBluefox) Allowed connections behind reverse proxy
$3
- (@GermanBluefox) Added methods: subscribeFiles, unsubscribeFiles
$3
- (@GermanBluefox) Extended
getVersion command with update$3
- (AlCalzone) corrected: reload on websocket error instead of alert()-ing
$3
- (@GermanBluefox) Added
logout command
- (@GermanBluefox) Move getGroups to web connection$3
- (jogibear998) Fix connection with web adapter
- (jogibear998 & AlCalzone) Convert package to a CommonJS/ESM hybrid
$3
- (@GermanBluefox) Fixed
getInstalled` command- (@GermanBluefox) Improved the vendor support
- (AlCalzone) setSystemConfig simplified
- (AlCalzone) The package was completely rewritten to make proper use of TypeScript
- (@GermanBluefox) Fix the renaming of groups
- (jogibear9988) Test release
- (@GermanBluefox) Update methods
- (UncleSamSwiss) Add release script and release workflow
- (jogibear9988) Create the Repository from the Code in https://github.com/ioBroker/adapter-react
The MIT License (MIT)
Copyright (c) 2021-2025 Jochen Kühner