@nomad-media/full 1.1.28 → 2026.9.2-beta.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 +74 -93
- package/dist/nomad-media-sdk-debug.js +14112 -4056
- package/dist/nomad-media-sdk.min.js +5 -5
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -1,93 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
>
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
> 🚧 Make sure to keep your configuration options secret and do not share them publicly.
|
|
76
|
-
|
|
77
|
-
## Upgrading NPM
|
|
78
|
-
|
|
79
|
-
To upgrade the npm, use the following command:
|
|
80
|
-
|
|
81
|
-
```shell
|
|
82
|
-
npm update @nomad-media/full
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## Nomad SDK References
|
|
86
|
-
|
|
87
|
-
An overview of all of the Nomad SDK methods. Includes prameter details for the methods. Scroll down to the Nomad SDK section.
|
|
88
|
-
|
|
89
|
-
[Nomad SDK References](https://developer.nomad-cms.com/reference)
|
|
90
|
-
|
|
91
|
-
## Nomad SDK NPM Samples
|
|
92
|
-
|
|
93
|
-
[Nomad SDK NPM Samples](https://github.com/Nomad-Media/samples-js)
|
|
1
|
+
# @nomad-media/full
|
|
2
|
+
|
|
3
|
+
Official JavaScript SDK for the [Nomad Media API](https://docs.nomad.media): admin and portal endpoints.
|
|
4
|
+
For the media-only subset, see [`@nomad-media/public`](https://www.npmjs.com/package/@nomad-media/public).
|
|
5
|
+
|
|
6
|
+
> **Beta.** The 2026.9 line is a pre-release. Install it with the `beta` tag and
|
|
7
|
+
> [report problems](https://github.com/Nomad-Media/sdk-javascript/issues).
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```shell
|
|
12
|
+
npm install @nomad-media/full@beta
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Requires Node.js 18 or higher.
|
|
16
|
+
|
|
17
|
+
## Quick start
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
import NomadMediaSDK from "@nomad-media/full";
|
|
21
|
+
|
|
22
|
+
const sdk = new NomadMediaSDK({
|
|
23
|
+
serviceApiUrl: "https://your-instance.demos.media",
|
|
24
|
+
username: "you@example.com",
|
|
25
|
+
password: "your-password", // or apiKey
|
|
26
|
+
apiType: "admin" // "admin" or "portal"
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// The SDK logs in automatically on the first call
|
|
30
|
+
const channels = await sdk.getLiveChannels();
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Failed calls throw an `Error` whose `.status` is the HTTP status:
|
|
34
|
+
|
|
35
|
+
```javascript
|
|
36
|
+
try {
|
|
37
|
+
await sdk.getAsset(assetId);
|
|
38
|
+
} catch (err) {
|
|
39
|
+
console.error(err.status, err.message);
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Uploads send the file in parts and return the new asset id:
|
|
44
|
+
|
|
45
|
+
```javascript
|
|
46
|
+
const assetId = await sdk.uploadAsset(null, null, null, "replace", "./video.mp4", folderId);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
For large files, pass `{ maxWorkers, partConfirmation, onProgress }` as the last argument.
|
|
50
|
+
|
|
51
|
+
## Upgrading from 1.x
|
|
52
|
+
|
|
53
|
+
- **Failed requests throw.** 1.x logged the error and returned `null`. Wrap calls in `try`/`catch`.
|
|
54
|
+
- **Timed-out writes are not retried.** A POST, PUT, PATCH or DELETE that times out throws.
|
|
55
|
+
- **Versions follow the API:** `YYYY.M.patch` (for example `2026.9.2`).
|
|
56
|
+
|
|
57
|
+
The full list of changes is in the [changelog](https://github.com/Nomad-Media/sdk-javascript/blob/main/CHANGELOG.md).
|
|
58
|
+
|
|
59
|
+
## Configuration
|
|
60
|
+
|
|
61
|
+
| Option | Description |
|
|
62
|
+
|--------|-------------|
|
|
63
|
+
| `serviceApiUrl` | Your API base URL. Required. |
|
|
64
|
+
| `username`, `password` / `apiKey` | Your credentials. Keep them secret. |
|
|
65
|
+
| `apiType` | `"admin"` or `"portal"`. |
|
|
66
|
+
| `debugMode` | Log API call details. |
|
|
67
|
+
|
|
68
|
+
An unminified build with parameter names is available as `@nomad-media/full/debug`.
|
|
69
|
+
|
|
70
|
+
## More
|
|
71
|
+
|
|
72
|
+
- [Documentation](https://docs.nomad.media)
|
|
73
|
+
- [Samples](https://github.com/Nomad-Media/samples-js)
|
|
74
|
+
- [Issues](https://github.com/Nomad-Media/sdk-javascript/issues)
|