# @eclipse-ditto/ditto-javascript-client-dom_1.0

> DOM implementation of Eclipse Ditto 1.0.x JavaScript API to be used in browsers.

Latest version **2.1.0** (published 2021-01-26) · SEE LICENSE IN LICENSE license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @eclipse-ditto/ditto-javascript-client-dom_1.0
pnpm add @eclipse-ditto/ditto-javascript-client-dom_1.0
yarn add @eclipse-ditto/ditto-javascript-client-dom_1.0
bun add @eclipse-ditto/ditto-javascript-client-dom_1.0
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2021-01-26 |
| First published | 2019-12-12 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 90.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Eclipse Ditto committers |
| Maintainers | florian.fendt.bosch, eclipse_ditto |
| Keywords | ditto, eclipse, eclipseditto, client, iot, iife, dom, browser |

## Links

- npm: https://www.npmjs.com/package/@eclipse-ditto/ditto-javascript-client-dom_1.0
- Repository: https://github.com/eclipse/ditto-clients
- Homepage: https://github.com/eclipse/ditto-clients#readme
- Issues: https://github.com/eclipse/ditto-clients/issues
- npm.io page: https://npm.io/package/@eclipse-ditto/ditto-javascript-client-dom_1.0

## Dependencies (1)

- [@eclipse-ditto/ditto-javascript-client-api_1.0](https://npm.io/package/@eclipse-ditto/ditto-javascript-client-api_1.0.md) ^2.1.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.1.0 (latest) — 2021-01-26
- 2.0.0 — 2020-05-13
- 1.0.0 — 2019-12-12

## README

# Ditto JavaScript DOM client

Implementation of the Eclipse Ditto JavaScript API that uses functionality of DOM environments, 
e.g. `btoa()` or `WebSocket`.

It is published with two different module types to the npm registry:
* IIFE (`dist/index.bundle.js`), for using it directly in a browser. The functionality is available under the base name
`EclipseDittoJavascriptClient`. You can use a CDN like [UNPKG](https://unpkg.com/) to directly
use it in a HTML document without the need to compile or pack anything.
* ES Module (`dist/index.es.js`)


## Building
Basically it makes sense to trigger the build process once from
the [parent module](../../README.md). Then you'll be able to
use the default build process in here:

```
npm install
npm run build
npm run lint
npm test
# or npm run test:watch
```

## Using

```
# replace <ditto-major.minor> with the major and minor version number of Eclipse Ditto you are using.
npm i --save  @eclipse/ditto-javascript-client-api_<ditto-major.minor> @eclipse/ditto-javascript-client-dom_<ditto-major.minor>
```

Create an instance of a client:

```
const domain = 'localhost:8080';
const username = 'ditto';
const password = 'ditto';

// could also use newWebSocketClient() for the WebSocket implementation
const client = DittoDomClient.newHttpClient()
            .withoutTls()
            .withDomain(domain)
            .withAuthProvider(DomHttpBasicAuth.newInstance(username, password))
            .apiVersion2()
            .build();
```

To find out how to use the client, have a look at the [api documentation](../api/README.md#Using-the-client),
since the API will stay the same no matter what implementation is used.

---
_Source: https://npm.io/package/@eclipse-ditto/ditto-javascript-client-dom_1.0 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
