open-index/open-npm huggingface dataset:
npm package: @memfault/cdr-renderer-toolkit
Description: A toolkit to build React applications for rendering proprietary Custom Data Recordings (CDRs) within Memfault.
Author: Memfault Inc.
Latest version: 0.1.2

# `@memfault/cdr-renderer-toolkit`

A toolkit to build React applications meant to be rendered inside an `iframe`
within Memfault that can render special or proprietary Custom Data Recordings.

## Usage

```tsx
import React from "react";
import { useFragmentData } from "@memfault/cdr-renderer-toolkit";

function App() {
  const { data, error, isLoading, isExampleData, isExpired } = useFragmentData({
    exampleDownloadUrl: "/path/to/example-data.bin",
  });

  if (isLoading) return <div>Loading...</div>;
  if (error) return <div>Error: {error}</div>;

  return (
    <div>
      {isExampleData && <p>Using example data</p>}
      {isExpired && <p>Download URL has expired</p>}
      <p>
        Data size: {data ? `${data.byteLength} bytes` : "No data available"}
      </p>
    </div>
  );
}
```

## Development

### Using the Nix package manager

Install [Nix](https://nixos.org/download/) and [`direnv`](https://direnv.net/) and run:

```sh
cp .envrc.example .envrc
direnv allow
yarn
yarn build
```

If you don't want to use `direnv`, you can also do the following:

```sh
nix develop
yarn
yarn build
```

### Using other package managers

Install system dependencies:

- [`biomejs`](https://biomejs.dev/): `^1.9.4`
- [`node`](https://nodejs.org/): `^20.18.0`
- [`yarn`](https://yarnpkg.com/): `^1.22`

Bootstrap and build:

```sh
yarn
yarn build
```

### Running tests

```sh
yarn test
```

## Publishing

```
yarn build
npm login
npm publish
```
npm package: @memizy/multiplayer-sdk
Description: TypeScript SDK for building Memizy multiplayer plugins with a declarative postMessage API.
Latest version: 0.2.3

# Memizy Multiplayer SDK

TypeScript SDK for Memizy multiplayer plugins. It provides a declarative `postMessage` bridge for host and player plugins, plus manifest and sandbox helpers for standalone development.

Version: `0.2.0`

## What changed in v0.2

- Plugins announce readiness with `PLUGIN_READY`.
- Hosts respond with `INIT_SESSION`.
- `MULTI_INIT` is still accepted as a legacy fallback for older plugins.
- The sandbox emits both `INIT_SESSION` and `MULTI_INIT` so existing examples keep working while you migrate.

## Core APIs

- `createMultiplayerPlugin()` creates the host/player bridge.
- `loadManifestFromDataIsland()` reads an OQSE manifest from `<script type="application/oqse-manifest+json">`.
- `renderLandingPageIfNeeded()` renders a standalone landing page when the plugin is opened outside an iframe.
- `createLocalSandbox()` mounts a local host/player preview for development.

## Minimal plugin flow

```ts
import { createMultiplayerPlugin } from '@memizy/multiplayer-sdk'

const sdk = createMultiplayerPlugin()

sdk.defineHost({
	onInit(context) {
		console.log('host init', context)
	},
	onPlayerAction(action, playerId) {
		console.log('player action', playerId, action)
	},
})

sdk.definePlayer({
	onInit(context) {
		console.log('player init', context)
	},
	onStateUpdate(state) {
		console.log('state update', state)
	},
})

sdk.start()
```

## Manifest data island

```html
<script type="application/oqse-manifest+json">
{
	"version": "0.1",
	"id": "https://example.com/plugins/my-plugin/",
	"appName": "My Plugin",
	"description": "Standalone Memizy plugin",
	"capabilities": {
		"actions": ["render"],
		"types": ["mcq-single", "short-answer"]
	}
}
</script>
```

## Standalone usage

When the plugin is opened directly in the browser, `renderLandingPageIfNeeded()` shows a lightweight landing page with manifest details and links to the docs and sandbox.

## Local sandbox

Use `createLocalSandbox({ mount, pluginUrl })` to mount a host and player iframe side by side and test the handshake locally.

Standalone quiz example: https://github.com/memizy/multiplayer-quiz