@zerodot/spotify 1.0.0 → 1.0.1

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 (2) hide show
  1. package/README.md +53 -15
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -1,24 +1,62 @@
1
1
  # @zerodot/spotify
2
2
 
3
- Spotify node package for zerodot.
3
+ <img src="https://raw.githubusercontent.com/zerodot-io/nodes/main/packages/spotify/spotify.svg" alt="Spotify logo" width="48" height="48">
4
4
 
5
- ## Credential
5
+ Search tracks, artists, albums, and playlists on Spotify. Get a track, artist, album, or playlist by ID, and get the current user. Connect with a Spotify OAuth 2.0 access token.
6
6
 
7
- Create a **Spotify access token** credential with an OAuth 2.0 access token from the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard) or OAuth flow.
7
+ ## Install
8
8
 
9
- - The token must have the scopes required by the operations you use.
10
- - Getting the current user (`/me`) requires a user-context token with `user-read-private` and/or `user-read-email` scopes.
9
+ In zerodot, go to **System > Nodes** and install **Spotify**.
11
10
 
12
- ## Operations
11
+ Manual: install `@zerodot/spotify` where the web app and the worker run, and add it to `ZERODOT_NODE_PACKAGES`.
13
12
 
14
- - **Search**: Search Tracks, Artists, Albums, or Playlists
15
- - **Track**: Get
16
- - **Artist**: Get
17
- - **Album**: Get
18
- - **Playlist**: Get
19
- - **User**: Get Current User
13
+ ## Nodes
20
14
 
21
- ## Notes
15
+ ### Spotify (`spotify.api`)
22
16
 
23
- - Spotify Web API base URL: `https://api.spotify.com/v1`
24
- - Search supports types `track`, `artist`, `album`, and `playlist`.
17
+ The node calls the Spotify Web API at `https://api.spotify.com/v1`.
18
+
19
+ - **Search**: list
20
+ - **Track**: get
21
+ - **Artist**: get
22
+ - **Album**: get
23
+ - **Playlist**: get
24
+ - **User**: get current user (`getMe`)
25
+
26
+ **Search.** Set **Query** to the search text. Spotify search keywords and field filters work in the query. For example, `daft punk` searches for those words. **Type** sets the kind of item: track (the default), artist, album, or playlist. **Limit** sets the number of results per request, from 1 to 50 (default 20). **Offset** sets the index of the first result (default 0).
27
+
28
+ **Get.** Set the Spotify ID of the item: **Track ID**, **Artist ID**, **Album ID**, or **Playlist ID**. The node puts the ID in the path, and encodes it.
29
+
30
+ **User.** Get Current User returns the profile of the user that the token belongs to. It needs no input.
31
+
32
+ **Required fields.** Search needs **Query**. Each get operation needs its ID.
33
+
34
+ **Output.** The node gives the JSON answer of Spotify as it is. For a search, the answer is an object with one key for each type, for example `tracks`, and the items are in its `items` list. If Spotify sends no body, the output is `{ "success": true }`. If Spotify sends a JSON array or another value that is not an object, the output is `{ "value": ... }`.
35
+
36
+ **Pagination.** The node makes one request per run. To read more results, change **Offset** and run the node again. The node has no option to read all pages.
37
+
38
+ **Errors and limits.** When Spotify returns an error, the node fails with the status code and the message of Spotify. For 401, 403, and 429 errors, the message adds a short hint. The access token is never part of an error message. The node does not follow redirects. The **Timeout** (`timeoutMs`) of a request is 30000 ms by default, and up to 300000 ms.
39
+
40
+ **Destructive operations.** The node has no operation that changes data. All operations are reads.
41
+
42
+ **Binary data.** The node does not read or write binary data.
43
+
44
+ ## Credentials
45
+
46
+ - **Spotify access token** (`spotify.accessToken`):
47
+ - **Access Token** (`accessToken`): a Spotify OAuth 2.0 access token. This field is secret.
48
+
49
+ The node does not refresh the token. When Spotify rejects the token (401), paste a new token into the credential.
50
+
51
+ The token needs the scopes for the operations that you use. **Get Current User** needs a user token with the `user-read-private` and/or `user-read-email` scopes. The test of the credential calls the current user endpoint (`/me`). A token that the endpoint rejects fails the test.
52
+
53
+ Setup steps:
54
+
55
+ 1. Get an OAuth 2.0 access token from the [Spotify Developer Dashboard](https://developer.spotify.com/dashboard) or from your OAuth flow.
56
+ 2. In zerodot, create a **Spotify access token** credential.
57
+ 3. Paste the token into **Access Token**.
58
+ 4. Save the credential. zerodot calls the current user endpoint to test it.
59
+
60
+ ## License
61
+
62
+ AGPL-3.0-only
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@zerodot/spotify",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Search tracks, artists, albums, and playlists on Spotify. Use it to look up music, read playlists, and fetch the current user profile.",
5
5
  "license": "AGPL-3.0-only",
6
+ "homepage": "https://github.com/zerodot-io/nodes/tree/main/packages/spotify",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+https://github.com/zerodot-io/nodes.git",