@nomad-media/public 1.1.16 → 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 +67 -93
- package/dist/nomad-media-sdk-debug.js +1310 -235
- package/dist/nomad-media-sdk.min.js +5 -5
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -1,93 +1,67 @@
|
|
|
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
|
-
Place the config in a file called config.js and import it into your project.
|
|
70
|
-
|
|
71
|
-
You are now ready to use the SDK in your project.
|
|
72
|
-
|
|
73
|
-
> 📘 Contact: Make sure to contact Nomad Media support to get username, password, and url for your enviromnent.
|
|
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/public
|
|
2
|
+
|
|
3
|
+
Official JavaScript SDK for the [Nomad Media API](https://docs.nomad.media), limited to the
|
|
4
|
+
portal/media endpoints. For the admin endpoints too, see
|
|
5
|
+
[`@nomad-media/full`](https://www.npmjs.com/package/@nomad-media/full).
|
|
6
|
+
|
|
7
|
+
> **Beta.** The 2026.9 line is a pre-release. Install it with the `beta` tag and
|
|
8
|
+
> [report problems](https://github.com/Nomad-Media/sdk-javascript/issues).
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```shell
|
|
13
|
+
npm install @nomad-media/public@beta
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Requires Node.js 18 or higher.
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
```javascript
|
|
21
|
+
import NomadMediaSDK from "@nomad-media/public";
|
|
22
|
+
|
|
23
|
+
const sdk = new NomadMediaSDK({
|
|
24
|
+
serviceApiUrl: "https://your-instance.demos.media",
|
|
25
|
+
username: "you@example.com",
|
|
26
|
+
password: "your-password", // or apiKey
|
|
27
|
+
apiType: "portal"
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
// The SDK logs in automatically on the first call
|
|
31
|
+
const group = await sdk.getMediaGroup(groupId);
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Failed calls throw an `Error` whose `.status` is the HTTP status:
|
|
35
|
+
|
|
36
|
+
```javascript
|
|
37
|
+
try {
|
|
38
|
+
await sdk.getMediaGroup(groupId);
|
|
39
|
+
} catch (err) {
|
|
40
|
+
console.error(err.status, err.message);
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Upgrading from 1.x
|
|
45
|
+
|
|
46
|
+
- **Failed requests throw.** 1.x logged the error and returned `null`. Wrap calls in `try`/`catch`.
|
|
47
|
+
- **Timed-out writes are not retried.** A POST, PUT, PATCH or DELETE that times out throws.
|
|
48
|
+
- **Versions follow the API:** `YYYY.M.patch` (for example `2026.9.2`).
|
|
49
|
+
|
|
50
|
+
The full list of changes is in the [changelog](https://github.com/Nomad-Media/sdk-javascript/blob/main/CHANGELOG.md).
|
|
51
|
+
|
|
52
|
+
## Configuration
|
|
53
|
+
|
|
54
|
+
| Option | Description |
|
|
55
|
+
|--------|-------------|
|
|
56
|
+
| `serviceApiUrl` | Your API base URL. Required. |
|
|
57
|
+
| `username`, `password` / `apiKey` | Your credentials. Keep them secret. |
|
|
58
|
+
| `apiType` | `"portal"` for this package. |
|
|
59
|
+
| `debugMode` | Log API call details. |
|
|
60
|
+
|
|
61
|
+
An unminified build with parameter names is available as `@nomad-media/public/debug`.
|
|
62
|
+
|
|
63
|
+
## More
|
|
64
|
+
|
|
65
|
+
- [Documentation](https://docs.nomad.media)
|
|
66
|
+
- [Samples](https://github.com/Nomad-Media/samples-js)
|
|
67
|
+
- [Issues](https://github.com/Nomad-Media/sdk-javascript/issues)
|