# @werift/whip

> https://github.com/medooze/whip-whep-js

Latest version **0.0.3** (published 2025-02-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @werift/whip
pnpm add @werift/whip
yarn add @werift/whip
bun add @werift/whip
```

## 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.0.3 |
| Published | 2025-02-08 |
| First published | 2025-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 16.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | shinyoshiaki2012@gmail.com |
| Maintainers | shinyoshiaki |

## Links

- npm: https://www.npmjs.com/package/@werift/whip
- npm.io page: https://npm.io/package/@werift/whip

## Dependencies (2)

- [uuid](https://npm.io/package/uuid.md) ^11.0.3
- [werift](https://npm.io/package/werift.md) ^0.21.15

## Recent versions

- 0.0.3 (latest) — 2025-02-08
- 0.0.2 — 2025-01-25
- 0.0.1 — 2025-01-25

## README

https://github.com/medooze/whip-whep-js

# Example

## browser

```js
import { WhipSender } from "@shinyoshiaki/whip";

//Get mic+cam
const stream = await navigator.mediaDevices.getUserMedia({
  audio: true,
  video: true,
});

//Create peerconnection
const pc = new RTCPeerConnection();

//Send all tracks
for (const track of stream.getTracks()) {
  //You could add simulcast too here
  pc.addTrack(track);
}

//Create whip client
const whip = new WhipSender();

const url = "https://whip.test/whip/endpoint";
const token =
  "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IndoaXAgdGVzdCIsImlhdCI6MTUxNjIzOTAyMn0.jpM01xu_vnSXioxQ3I7Z45bRh5eWRBEY2WJPZ6FerR8";

//Start publishing
whip.publish(pc, url, token);
```

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