@tidal-music/api 0.1.0 → 0.2.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.
Files changed (4) hide show
  1. package/README.md +8 -0
  2. package/dist/index.d.ts +11695 -18209
  3. package/dist/index.js +214 -174
  4. package/package.json +14 -14
package/README.md CHANGED
@@ -13,6 +13,14 @@ See the `examples/` folder for some ways it can be used.
13
13
 
14
14
  To run it do: `pnpm dev`
15
15
 
16
+ ### Usage in Node.js
17
+ 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:
18
+
19
+ 1. Shim or polyfill `LocalStorage` into `Node.js`, for instance with something like: https://github.com/capaj/localstorage-polyfill
20
+ 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)`
21
+
22
+ Which approach to choose will depend on how much control you need over the Auth flow.
23
+
16
24
  ## Development
17
25
 
18
26
  Run `pnpm generateTypes` to regenerate the types from the API specs.