# @raydiant/sdk

> Raydiant SDK

Latest version **0.9.2** (published 2025-01-23) · 0 weekly downloads

## Install

```sh
npm install @raydiant/sdk
pnpm add @raydiant/sdk
yarn add @raydiant/sdk
bun add @raydiant/sdk
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.2 |
| Published | 2025-01-23 |
| First published | 2022-11-17 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 3.1 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | miratech |

## Links

- npm: https://www.npmjs.com/package/@raydiant/sdk
- npm.io page: https://npm.io/package/@raydiant/sdk

## Dependencies (1)

- [zod](https://npm.io/package/zod.md) ^3.22.4

## Recent versions

- 0.9.2 (latest) — 2025-01-23
- 0.6.0-canary-10131113 (canary) — 2023-10-13
- 0.9.1 — 2024-08-05
- 0.9.0 — 2024-05-13
- 0.8.1 — 2024-04-19
- 0.8.0 — 2024-04-16
- 0.7.1 — 2024-04-02
- 0.7.0 — 2023-11-17
- 0.6.1 — 2023-11-14
- 0.6.0 — 2023-10-20
- 0.6.0-canary-10131044 — 2023-10-13
- 0.5.0 — 2023-06-05
- 0.4.1 — 2023-04-06
- 0.4.0 — 2023-03-07
- 0.3.3 — 2022-11-29
- … 10 more at https://npm.io/package/@raydiant/sdk/versions

## README

# Raydiant SDK

A JavaScript library for interacting with the Raydiant runtime.

## Installation

### NPM

```bash
npm install @raydiant/sdk
# or yarn
yarn install @raydiant/sdk
```

```js
import { runtime, devTools } from '@raydiant/sdk';
```

### CDN

```html
<script src="https://cdn.raydiant.com/lib/raydiant-sdk@0.9.0.min.js"></script>
```

```js
const { runtime, devTools } = window.Raydiant;
```

## Usage

```js
// Send 'ready' event.
runtime.ready();

// Send 'complete' event.
runtime.complete();

// Send 'complete' event with error.
runtime.complete(new Error());

// Subscribe to the runtime's 'play' event.
const unsubscribe = runtime.subscribe('play', () => {
  // ...
});
```

### Developer Tools

Use the built-in developer tools to simulate sending and receiving events in local development. When you open your app directly in the browser the dev tools are automatically enabled.

```js
// Check if dev tools are enabled.
devTools.isEnabled();

// Simulate receiving 'play' from the playlist runtime.
devTools.play();

// Immediately call play again after complete, simulating a single presentation in the playlist.
devTools.play(true);

// Stop looping.
devTools.disableLoop();
```

## Contributing

See [CONTRIBUTING.md](docs/CONTRIBUTING.md) for instructions on how to contribute to the Raydiant SDK.

---
_Source: https://npm.io/package/@raydiant/sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
