Installation

Installation

Installation

Construct an authenticated client

The default export NomadMediaSDK mirrors the Python SDK and logs in lazily on the first call when username + password are present.

import NomadMediaSDK from "<path-to-sdk>/src/sdk.js";

const config = {
    serviceApiUrl: "https://nomad-admin-api.yourdomain.com/api",
    apiType: "admin",            // "admin" | "portal"
    username: "<from-config>",   // never hard-code
    password: "<from-config>",   // never hard-code
    debugMode: false,
};

const sdk = new NomadMediaSDK(config);
const asset = await sdk.getAsset("<asset-id>"); // login happens here on first call

Notes / gotchas

  • All catalog methods are async — always await them.
  • Method names are camelCase (createFolderAsset, getAsset). See ../reference/naming-map.md.
  • The SDK prints datetime lines on console.log/console.info (one echoes the username). In a harness, mute them before constructing the SDK to keep stdout clean and avoid leaking the username.
  • apiType must be "admin" for the asset/folder ops in this catalog.
  • search returns false (not an empty object) when there are no hits — see ../reference/return-shapes.md.
  • See Authentication for the login/secret-hygiene rules.