CloudSignal Docs
Getting Started

Installation

Install the @cloudsignal/mqtt-client package via npm, yarn, or pnpm.

@cloudsignal/mqtt-client is the official CloudSignal MQTT WebSocket client for browser and Node.js. Install it from npm with your package manager of choice.

Install

The package resolves to the latest published version (@latest) by default.

npm install @cloudsignal/mqtt-client
yarn add @cloudsignal/mqtt-client
pnpm add @cloudsignal/mqtt-client

Browsers without a bundler

For HTML-first pages that don't use a bundler, load the IIFE bundle from unpkg. The unversioned path resolves to the latest published bundle.

<script src="https://unpkg.com/@cloudsignal/mqtt-client/dist/index.global.js"></script>

The bundle exposes CloudSignal on the global namespace:

const client = new CloudSignal.default({
  organizationId: 'your-org-id',
});

Package formats

The library ships with three bundle formats. Your bundler picks the right one based on your import style.

FormatPathUse case
ESMdist/index.jsModern bundlers and ES modules
CJSdist/index.cjsNode.js require() usage
IIFEdist/index.global.jsBrowser <script> tags

Requirements

EnvironmentMinimum version
BrowserModern browsers with WebSocket support
Node.jsv16 or later (for server-side usage)

TypeScript support

TypeScript definitions are bundled with the package. No additional @types/* install is needed.

import { CloudSignalClient, CloudSignalConfig } from '@cloudsignal/mqtt-client';

const config: CloudSignalConfig = {
  organizationId: 'your-org-id',
  debug: true,
};

const client = new CloudSignalClient(config);

On this page