JSPM

@project-chip/matter.js

0.11.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1842
  • Score
    100M100P100Q114773F
  • License Apache-2.0

Matter protocol in pure js

Package Exports

  • @project-chip/matter.js
  • @project-chip/matter.js/behavior
  • @project-chip/matter.js/behavior/cluster
  • @project-chip/matter.js/behavior/clusters
  • @project-chip/matter.js/behaviors/access-control
  • @project-chip/matter.js/behaviors/account-login
  • @project-chip/matter.js/behaviors/actions
  • @project-chip/matter.js/behaviors/activated-carbon-filter-monitoring
  • @project-chip/matter.js/behaviors/administrator-commissioning
  • @project-chip/matter.js/behaviors/air-quality
  • @project-chip/matter.js/behaviors/alarm-base
  • @project-chip/matter.js/behaviors/application-basic
  • @project-chip/matter.js/behaviors/application-launcher
  • @project-chip/matter.js/behaviors/audio-output
  • @project-chip/matter.js/behaviors/ballast-configuration
  • @project-chip/matter.js/behaviors/basic-information
  • @project-chip/matter.js/behaviors/binding
  • @project-chip/matter.js/behaviors/boolean-state
  • @project-chip/matter.js/behaviors/boolean-state-configuration
  • @project-chip/matter.js/behaviors/bridged-device-basic-information
  • @project-chip/matter.js/behaviors/carbon-dioxide-concentration-measurement
  • @project-chip/matter.js/behaviors/carbon-monoxide-concentration-measurement
  • @project-chip/matter.js/behaviors/channel
  • @project-chip/matter.js/behaviors/color-control
  • @project-chip/matter.js/behaviors/concentration-measurement
  • @project-chip/matter.js/behaviors/content-app-observer
  • @project-chip/matter.js/behaviors/content-control
  • @project-chip/matter.js/behaviors/content-launcher
  • @project-chip/matter.js/behaviors/descriptor
  • @project-chip/matter.js/behaviors/device-energy-management
  • @project-chip/matter.js/behaviors/device-energy-management-mode
  • @project-chip/matter.js/behaviors/diagnostic-logs
  • @project-chip/matter.js/behaviors/dishwasher-alarm
  • @project-chip/matter.js/behaviors/dishwasher-mode
  • @project-chip/matter.js/behaviors/door-lock
  • @project-chip/matter.js/behaviors/electrical-energy-measurement
  • @project-chip/matter.js/behaviors/electrical-power-measurement
  • @project-chip/matter.js/behaviors/energy-evse
  • @project-chip/matter.js/behaviors/energy-evse-mode
  • @project-chip/matter.js/behaviors/energy-preference
  • @project-chip/matter.js/behaviors/ethernet-network-diagnostics
  • @project-chip/matter.js/behaviors/fan-control
  • @project-chip/matter.js/behaviors/fixed-label
  • @project-chip/matter.js/behaviors/flow-measurement
  • @project-chip/matter.js/behaviors/formaldehyde-concentration-measurement
  • @project-chip/matter.js/behaviors/general-commissioning
  • @project-chip/matter.js/behaviors/general-diagnostics
  • @project-chip/matter.js/behaviors/group-key-management
  • @project-chip/matter.js/behaviors/groups
  • @project-chip/matter.js/behaviors/hepa-filter-monitoring
  • @project-chip/matter.js/behaviors/icd-management
  • @project-chip/matter.js/behaviors/identify
  • @project-chip/matter.js/behaviors/illuminance-measurement
  • @project-chip/matter.js/behaviors/index
  • @project-chip/matter.js/behaviors/keypad-input
  • @project-chip/matter.js/behaviors/label
  • @project-chip/matter.js/behaviors/laundry-dryer-controls
  • @project-chip/matter.js/behaviors/laundry-washer-controls
  • @project-chip/matter.js/behaviors/laundry-washer-mode
  • @project-chip/matter.js/behaviors/level-control
  • @project-chip/matter.js/behaviors/localization-configuration
  • @project-chip/matter.js/behaviors/low-power
  • @project-chip/matter.js/behaviors/media-input
  • @project-chip/matter.js/behaviors/media-playback
  • @project-chip/matter.js/behaviors/messages
  • @project-chip/matter.js/behaviors/microwave-oven-control
  • @project-chip/matter.js/behaviors/microwave-oven-mode
  • @project-chip/matter.js/behaviors/mode-base
  • @project-chip/matter.js/behaviors/mode-select
  • @project-chip/matter.js/behaviors/network-commissioning
  • @project-chip/matter.js/behaviors/nitrogen-dioxide-concentration-measurement
  • @project-chip/matter.js/behaviors/occupancy-sensing
  • @project-chip/matter.js/behaviors/on-off
  • @project-chip/matter.js/behaviors/operational-credentials
  • @project-chip/matter.js/behaviors/operational-state
  • @project-chip/matter.js/behaviors/ota-software-update-provider
  • @project-chip/matter.js/behaviors/ota-software-update-requestor
  • @project-chip/matter.js/behaviors/oven-cavity-operational-state
  • @project-chip/matter.js/behaviors/oven-mode
  • @project-chip/matter.js/behaviors/ozone-concentration-measurement
  • @project-chip/matter.js/behaviors/pm1-concentration-measurement
  • @project-chip/matter.js/behaviors/pm10-concentration-measurement
  • @project-chip/matter.js/behaviors/pm25-concentration-measurement
  • @project-chip/matter.js/behaviors/power-source
  • @project-chip/matter.js/behaviors/power-source-configuration
  • @project-chip/matter.js/behaviors/power-topology
  • @project-chip/matter.js/behaviors/pressure-measurement
  • @project-chip/matter.js/behaviors/proxy-configuration
  • @project-chip/matter.js/behaviors/proxy-discovery
  • @project-chip/matter.js/behaviors/pulse-width-modulation
  • @project-chip/matter.js/behaviors/pump-configuration-and-control
  • @project-chip/matter.js/behaviors/radon-concentration-measurement
  • @project-chip/matter.js/behaviors/refrigerator-alarm
  • @project-chip/matter.js/behaviors/refrigerator-and-temperature-controlled-cabinet-mode
  • @project-chip/matter.js/behaviors/relative-humidity-measurement
  • @project-chip/matter.js/behaviors/resource-monitoring
  • @project-chip/matter.js/behaviors/rvc-clean-mode
  • @project-chip/matter.js/behaviors/rvc-operational-state
  • @project-chip/matter.js/behaviors/rvc-run-mode
  • @project-chip/matter.js/behaviors/scenes-management
  • @project-chip/matter.js/behaviors/smoke-co-alarm
  • @project-chip/matter.js/behaviors/software-diagnostics
  • @project-chip/matter.js/behaviors/switch
  • @project-chip/matter.js/behaviors/target-navigator
  • @project-chip/matter.js/behaviors/temperature-control
  • @project-chip/matter.js/behaviors/temperature-measurement
  • @project-chip/matter.js/behaviors/thermostat
  • @project-chip/matter.js/behaviors/thermostat-user-interface-configuration
  • @project-chip/matter.js/behaviors/thread-network-diagnostics
  • @project-chip/matter.js/behaviors/time-format-localization
  • @project-chip/matter.js/behaviors/time-synchronization
  • @project-chip/matter.js/behaviors/total-volatile-organic-compounds-concentration-measurement
  • @project-chip/matter.js/behaviors/unit-localization
  • @project-chip/matter.js/behaviors/user-label
  • @project-chip/matter.js/behaviors/valid-proxies
  • @project-chip/matter.js/behaviors/valve-configuration-and-control
  • @project-chip/matter.js/behaviors/wake-on-lan
  • @project-chip/matter.js/behaviors/wi-fi-network-diagnostics
  • @project-chip/matter.js/behaviors/window-covering
  • @project-chip/matter.js/ble
  • @project-chip/matter.js/certificate
  • @project-chip/matter.js/cluster
  • @project-chip/matter.js/codec
  • @project-chip/matter.js/common
  • @project-chip/matter.js/crypto
  • @project-chip/matter.js/datatype
  • @project-chip/matter.js/device
  • @project-chip/matter.js/devices/AirPurifierDevice
  • @project-chip/matter.js/devices/AirQualitySensorDevice
  • @project-chip/matter.js/devices/BasicVideoPlayerDevice
  • @project-chip/matter.js/devices/CastingVideoClientDevice
  • @project-chip/matter.js/devices/CastingVideoPlayerDevice
  • @project-chip/matter.js/devices/ColorDimmerSwitchDevice
  • @project-chip/matter.js/devices/ColorTemperatureLightDevice
  • @project-chip/matter.js/devices/ContactSensorDevice
  • @project-chip/matter.js/devices/ContentAppDevice
  • @project-chip/matter.js/devices/ControlBridgeDevice
  • @project-chip/matter.js/devices/CookSurfaceDevice
  • @project-chip/matter.js/devices/CooktopDevice
  • @project-chip/matter.js/devices/DimmableLightDevice
  • @project-chip/matter.js/devices/DimmablePlugInUnitDevice
  • @project-chip/matter.js/devices/DimmerSwitchDevice
  • @project-chip/matter.js/devices/DishwasherDevice
  • @project-chip/matter.js/devices/DoorLockControllerDevice
  • @project-chip/matter.js/devices/DoorLockDevice
  • @project-chip/matter.js/devices/ExtendedColorLightDevice
  • @project-chip/matter.js/devices/ExtractorHoodDevice
  • @project-chip/matter.js/devices/FanDevice
  • @project-chip/matter.js/devices/FlowSensorDevice
  • @project-chip/matter.js/devices/GenericSwitchDevice
  • @project-chip/matter.js/devices/HumiditySensorDevice
  • @project-chip/matter.js/devices/IndexDevice
  • @project-chip/matter.js/devices/LaundryDryerDevice
  • @project-chip/matter.js/devices/LaundryWasherDevice
  • @project-chip/matter.js/devices/LightSensorDevice
  • @project-chip/matter.js/devices/MicrowaveOvenDevice
  • @project-chip/matter.js/devices/ModeSelectDevice
  • @project-chip/matter.js/devices/OccupancySensorDevice
  • @project-chip/matter.js/devices/OnOffLightDevice
  • @project-chip/matter.js/devices/OnOffLightSwitchDevice
  • @project-chip/matter.js/devices/OnOffPlugInUnitDevice
  • @project-chip/matter.js/devices/OnOffSensorDevice
  • @project-chip/matter.js/devices/OvenDevice
  • @project-chip/matter.js/devices/PressureSensorDevice
  • @project-chip/matter.js/devices/PumpControllerDevice
  • @project-chip/matter.js/devices/PumpDevice
  • @project-chip/matter.js/devices/RainSensorDevice
  • @project-chip/matter.js/devices/RefrigeratorDevice
  • @project-chip/matter.js/devices/RoboticVacuumCleanerDevice
  • @project-chip/matter.js/devices/RoomAirConditionerDevice
  • @project-chip/matter.js/devices/SmokeCoAlarmDevice
  • @project-chip/matter.js/devices/SpeakerDevice
  • @project-chip/matter.js/devices/TemperatureControlledCabinetDevice
  • @project-chip/matter.js/devices/TemperatureSensorDevice
  • @project-chip/matter.js/devices/ThermostatDevice
  • @project-chip/matter.js/devices/VideoRemoteControlDevice
  • @project-chip/matter.js/devices/WaterFreezeDetectorDevice
  • @project-chip/matter.js/devices/WaterLeakDetectorDevice
  • @project-chip/matter.js/devices/WaterValveDevice
  • @project-chip/matter.js/devices/WindowCoveringControllerDevice
  • @project-chip/matter.js/devices/WindowCoveringDevice
  • @project-chip/matter.js/devices/index
  • @project-chip/matter.js/endpoint
  • @project-chip/matter.js/endpoint/definitions
  • @project-chip/matter.js/endpoints/AggregatorEndpoint
  • @project-chip/matter.js/endpoints/BaseEndpoint
  • @project-chip/matter.js/endpoints/BridgedNodeEndpoint
  • @project-chip/matter.js/endpoints/DeviceEnergyManagementEndpoint
  • @project-chip/matter.js/endpoints/ElectricalSensorEndpoint
  • @project-chip/matter.js/endpoints/IndexEndpoint
  • @project-chip/matter.js/endpoints/OtaProviderEndpoint
  • @project-chip/matter.js/endpoints/OtaRequestorEndpoint
  • @project-chip/matter.js/endpoints/PowerSourceEndpoint
  • @project-chip/matter.js/endpoints/RootEndpoint
  • @project-chip/matter.js/endpoints/index
  • @project-chip/matter.js/environment
  • @project-chip/matter.js/fabric
  • @project-chip/matter.js/interaction
  • @project-chip/matter.js/log
  • @project-chip/matter.js/math
  • @project-chip/matter.js/mdns
  • @project-chip/matter.js/model
  • @project-chip/matter.js/net
  • @project-chip/matter.js/node
  • @project-chip/matter.js/package.json
  • @project-chip/matter.js/protocol
  • @project-chip/matter.js/schema
  • @project-chip/matter.js/securechannel
  • @project-chip/matter.js/storage
  • @project-chip/matter.js/tags/ClosureTag
  • @project-chip/matter.js/tags/CompassDirectionTag
  • @project-chip/matter.js/tags/CompassLocationTag
  • @project-chip/matter.js/tags/DirectionTag
  • @project-chip/matter.js/tags/ElectricalMeasurementTag
  • @project-chip/matter.js/tags/LaundryTag
  • @project-chip/matter.js/tags/LevelTag
  • @project-chip/matter.js/tags/LocationTag
  • @project-chip/matter.js/tags/NumberTag
  • @project-chip/matter.js/tags/PositionTag
  • @project-chip/matter.js/tags/PowerSourceTag
  • @project-chip/matter.js/tags/RefrigeratorTag
  • @project-chip/matter.js/tags/RoomAirConditionerTag
  • @project-chip/matter.js/tags/SwitchesTag
  • @project-chip/matter.js/tags/index
  • @project-chip/matter.js/time
  • @project-chip/matter.js/tlv
  • @project-chip/matter.js/util

Readme

@project-chip/matter.js

[!IMPORTANT] With matter.js 0.11.0 the package structure was adjusted. This package is exposing the current API for Controller implementations (a new API will follow soon) and the Legacy Device building Node API and mainly contains compatibility re-exports. Please adjust your code to just use the relevant exports from here and switch for all other matter.js general packages to the @matter/main package.

Implementation of Matter protocol in typescript with no native dependencies (and very limited dependencies).

This is the JavaScript-only Core of the Matter protocol. It is used by other projects to implement Matter Nodes and Clients and add the relevant specific implementations for Network and other elements.

This package supports all Node.js LTS versions starting with 18.x

The following features are abstracted away to allow to be implemented environment specific:

  • Network (UDP/MDNS)
  • Crypto
  • Storage
  • Date/Timer
  • Logger (Default uses "console")
  • Environment (Process and Configuration handling)

Exported functionality

This library exports the Matter protocol functionality as well as some helper functions as named exports:

Export Description
@project-chip/matter.js Exports the API to implement a Device or a Controller.
@project-chip/matter.js/behavior Exports Behavior classes (New API) as framework to implement all relevant Logic for clusters and internal logic. Contains auto-generated class structures and also Cluster default implementations.
@project-chip/matter.js/certificate Exports Certificate (Root-/PAA/PAI/IAC/DA-Certificates) related functionality
@project-chip/matter.js/cluster Exports Matter Cluster definitions and Default Cluster-Handlers
@project-chip/matter.js/codec Exports Codecs for e.g. Matter-Messages
@project-chip/matter.js/common Exports certain common functionalities
@project-chip/matter.js/crypto Exports Crypto related abstract functionality that needs to be implemented platform specific!
@project-chip/matter.js/datatype Exports Matter Data types
@project-chip/matter.js/device Exports Matter Device relevant classes (Legacy API!)
@project-chip/matter.js/devices Exports Matter Device type classes (NEW API!)
@project-chip/matter.js/endpoint Exports Matter Endpoint structure classes (NEW API!)
@project-chip/matter-.js/environment Exports environment functionalities, which handles central functions like MDNS and configuration
@project-chip/matter.js/elements Exports every standard Matter element defined by the Matter Object Model
@project-chip/matter.js/fabric Exports Matter-Fabric functionality
@project-chip/matter.js/interaction Exports Matter Interaction protocol functionality
@project-chip/matter.js/log Exports Logging functionality (based on "console")
@project-chip/matter.js/math Exports Math functionality used by Matter
@project-chip/matter.js/mdns Exports Basic MDNS functionality (uses Network implementation)
@project-chip/matter.js/model Exports a JavaScript version of the Matter data model
@project-chip/matter.js/net Exports Basic Network abstract functionality that needs to be implemented platform specific!
@project-chip/matter.js/node Exports Matter Node functionality which is used as basis for a device or controller (NEW API!). It also contains Matter Interaction model abstractions for the new API.
@project-chip/matter.js/protocol Exports Basic Matter protocol functionality
@project-chip/matter.js/schema Exports Schema definitions and functionality
@project-chip/matter.js/securechannel Exports Secure Channel functionality
@project-chip/matter.js/session Exports Session and Secure-Session functionality
@project-chip/matter.js/spec Exports Matter Specification References
@project-chip/matter.js/storage Exports Basic Storage abstract functionality that needs to be implemented platform specific!
@project-chip/matter.js/tags Exports Semantic Tag Standard namespace definitions of the Matter specification
@project-chip/matter.js/time Exports Basic Time/Timer abstract functionality that needs to be implemented platform specific!
@project-chip/matter.js/tlv Exports Matter TLV type definitions
@project-chip/matter.js/util Exports Basic Utility functionality

Both exports and the typings are exported as CommonJS and ES6 modules.

For more details please refer to the API Documentation.

For more details see the main package documentation.

Typescript note

To have Typescript and your IDE know all the relevant exported functionality you need to use the following in your tsconfig.json:

{
    compilerOptions: {
        moduleResolution: "node16", // Required to support package.json exports
        module: "node16", // Required to make sure all imports are js
    },
}

Additionally, we recommend using "strictNullChecks": true or better for code quality "strict": true to make sure that all types are correctly determined.

Building

  • npm run build: Build all code and create CommonJS and ES6 variants in dist directory. This will built incrementally and only build the changed files.
  • npm run build-clean: Clean the dist directory and build all code from scratch

Tests

  • npm run test: Run all tests