@moviie/player-sdk 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/index.cjs +768 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +270 -0
- package/dist/index.d.ts +270 -0
- package/dist/index.js +735 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @moviie/player-sdk
|
|
2
|
+
|
|
3
|
+
Vendor-agnostic HTTP client for Moviie playback metadata and telemetry. Works in Node, browsers, and React Native.
|
|
4
|
+
|
|
5
|
+
## Playback (`getPlayback`)
|
|
6
|
+
|
|
7
|
+
`MoviieClient.getPlayback(embedId)` calls `GET /v1/embeds/{embedId}/playback` against the configured API base. You **must** configure a **publishable** API key (`mvi_pub_*`) on the client. Missing keys and non-publishable keys throw `MoviieAuthError` before any network request (see `SDK_PLAYBACK_AUTH_ERROR_MESSAGE` in `./constants`).
|
|
8
|
+
|
|
9
|
+
Private/admin keys belong only on the server; they are **not** accepted by the playback endpoint.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @moviie/player-sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## API base URL
|
|
18
|
+
|
|
19
|
+
The default base is **`MOVIIE_DEFAULT_API_BASE_URL`** (`https://api.moviie.ai/v1`), aligned with the public OpenAPI production server.
|
|
20
|
+
|
|
21
|
+
- **Expo:** pass **`apiBaseUrl`** on the `@moviie/player-expo` config plugin. It is written to `expo.extra` and applied at runtime via `configureMoviieEndpoints`.
|
|
22
|
+
- **Node / scripts / tests:** call **`configureMoviieEndpoints({ apiBaseUrl: "https://your-host/v1" })`** before using `MoviieClient`, or rely on the default. Use **`resetMoviieEndpointsConfiguration()`** in tests between cases.
|
|
23
|
+
|
|
24
|
+
Telemetry uses the **same origin** as the Public API with path **`MOVIIE_TELEMETRY_API_PATH_PREFIX`** (`/telemetry/v1`). `getMoviieEventsBaseUrl()` derives `{apiOrigin}/telemetry/v1` from `getMoviieApiBaseUrl()` unless you pass **`eventsBaseUrl`** into **`configureMoviieEndpoints`** (or the Expo plugin sets **`moviieEventsBaseUrl`** in `expo.extra`).
|
|
25
|
+
|
|
26
|
+
Pass **`publishableKey`** and optional **`clientInfo`** when constructing **`MoviieClient`**.
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
UNLICENSED — Moviie proprietary.
|