Documentation
    Preparing search index...

    Module @tidal-music/api - v0.56.0

    TIDAL API

    A thin wrapper around the API domains described at: https://tidal-music.github.io/tidal-api-reference/ (which is again built on the JSON API spec: https://jsonapi.org/format/)

    The module provides Typescript types and a fetch based function for getting data, using: https://openapi-ts.pages.dev/

    One function is exposed that can be used for creating a function that can then do network calls: createAPIClient. Also the API types are exposed and can be used directly.

    See the examples/ folder for some ways it can be used.

    To run it do: pnpm dev

    The previous examples assume usage in a browser context, but for server-side / Node.js usage there is an extra step needed. As the Auth package uses LocalStorage you have two options:

    1. Shim or polyfill LocalStorage into Node.js, for instance with something like: https://github.com/capaj/localstorage-polyfill
    2. Implementing a CredentialsProvider per the interface defined here: https://github.com/tidal-music/tidal-sdk-web/blob/main/packages/common/src/credentialsProvider.ts (more details on how it should work in the Auth module and related spec: https://github.com/tidal-music/tidal-sdk-web/tree/main/packages/auth) and pass that in when initializing this module: createAPIClient(myAuthProvider)

    Which approach to choose will depend on how much control you need over the Auth flow.

    The package includes the OpenAPI document used to generate its TypeScript types. Tools and validators can import it separately from the client:

    import spec from '@tidal-music/api/openapi.json' with { type: 'json' };
    

    In Node.js, import.meta.resolve('@tidal-music/api/openapi.json') also resolves the document for tools that read JSON from disk. The document is pinned to the package version and is not imported by the client entry point.

    Run pnpm generateTypes to regenerate the types from bin/tidal-api-oas.json. The API update workflow refreshes that document and its generated types together. .

    paths
    RetryOptions
    createAPIClient