For the full specification, see the Player specification.
npm install @tidal-music/player (or similar for other package managers)
Then see the docs or the examples elsewhere in this repository.
The src/ folder contains the source code. Structured under api/ is the outside facing API. The player/ folder contains the underlying players and their integration into TIDAL player. The internal/ folder the business logic that the outside facing API end up calling.
The dist/ folder contains the latest built version of the code in src/.
The dev server runs at https://dev.tidal.com:5173. Cert generation and trust
are handled by vite-plugin-mkcert;
nothing cert-related is checked in.
One-time setup per machine:
Add a hosts entry so dev.tidal.com resolves locally:
echo "127.0.0.1 dev.tidal.com" | sudo tee -a /etc/hosts
Run pnpm dev once. The first run will prompt for sudo so mkcert can
install its local root CA into the system trust store. Subsequent runs are
silent.
Behind a corporate proxy, prefix the command with HTTPS_PROXY=... so mkcert
can download its binary. To wipe and re-trust:
mkcert -uninstall && rm -rf "$(mkcert -CAROOT)".
Building is done with Vite.
pnpm build to build the package to dist/
pnpm test. You need a .env file containing TEST_USER="base64string" before running. base64string is base 64 encoded stringified JS object containing oAuthAccessToken, oAuthRefreshToken, oAuthExpirationDate and clientId.
Cypress E2E specs target https://dev.tidal.com:5173, so the one-time setup
above is also a prerequisite for pnpm cypress:open / pnpm cypress:run.
To load TIDAL Player into a project locally without publishing to npm; using pnpm link, yarn link or npm link can be problematic, especially if your project does not also use pnpm like this repo does. If so, you need to manually configure a "hard link" using the file: protocol in package.json of the destination project like so:
"resolutions" property on the top level. (this is an object)"@tidal-music/player": "file:/Users/<your-username>/dev/tidal-sdk-web/packages/player"npm/yarn/pnpm install in your destination project.!! Remove the entry in "resolution" and run npm/yarn/pnpm install again when you are done testing to have the NPM version of the package load instead.