{"_id":"spotify-connect","_rev":"37-bf0b0de7842bac790d8dc98544998816","name":"spotify-connect","dist-tags":{"latest":"1.7.0"},"versions":{"1.2.0":{"name":"spotify-connect","version":"1.2.0","keywords":["spotify","nextjs","rfc","playlist"],"author":{"name":"Aquib Baig"},"license":"MIT","_id":"spotify-connect@1.2.0","maintainers":[{"name":"aquibbaig","email":"aquibbaig97@gmail.com"}],"homepage":"https://github.com/aquibbaig/spotify-connect#readme","bugs":{"url":"https://github.com/aquibbaig/spotify-connect/issues"},"dist":{"shasum":"a478fa38e50f5d5e242befdec3fd110f29d2b4b9","tarball":"https://registry.npmjs.org/spotify-connect/-/spotify-connect-1.2.0.tgz","fileCount":8,"integrity":"sha512-eafjNhLrL++puJNeHjW6mqsz+BlePi3U+y1WfAcBO5PbeEdmDaZ+UJke2ZKG1GkpVlB/zVGxLeOpibWnKbMtDg==","signatures":[{"sig":"MEUCIHLehNNxu8QlxK5dAMwUVq0rc5QyvcigD/uiBZGrpLenAiEA7d4eQYAtIxHgXQ/nV6y7T+rG1+rpfvW1HQjOBnCeDYE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":32241},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"24fabc2a6aa54cf64acc5710d3e4d4a0c7ea7db4","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"tsup"},"_npmUser":{"name":"aquibbaig","email":"aquibbaig97@gmail.com"},"repository":{"url":"git+https://github.com/aquibbaig/spotify-connect.git","type":"git"},"_npmVersion":"9.5.1","description":"Get useful analytics from the spotify API in your React app","directories":{},"_nodeVersion":"18.16.1","dependencies":{"react":"^18.2.0","@types/node":"^20.8.7","querystring":"^0.2.1","react-query":"^3.39.3"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.1","typescript":"^5.3.2","@types/react":"^18.2.29"},"_npmOperationalInternal":{"tmp":"tmp/spotify-connect_1.2.0_1701152940967_0.2721850275774196","host":"s3://npm-registry-packages"}},"1.3.0":{"name":"spotify-connect","version":"1.3.0","keywords":["spotify","nextjs","rfc","playlist"],"author":{"name":"Aquib Baig"},"license":"MIT","_id":"spotify-connect@1.3.0","maintainers":[{"name":"aquibbaig","email":"aquibbaig97@gmail.com"}],"homepage":"https://github.com/aquibbaig/spotify-connect#readme","bugs":{"url":"https://github.com/aquibbaig/spotify-connect/issues"},"dist":{"shasum":"b2fe200d4eb4e89c27fd6a1b31a4f480a21fea17","tarball":"https://registry.npmjs.org/spotify-connect/-/spotify-connect-1.3.0.tgz","fileCount":14,"integrity":"sha512-CEhvYVEkmpdNfxDaFbaUaGhvlaLb2ThK819q9oYTIqLzszJSGEpvcaOuVsYGQgjTktkPJhLKmQfK1B7K3AxJzQ==","signatures":[{"sig":"MEUCIQDkaYiEMpm70RBF9Mk/ZPI9X1dEPq5iWv4SRMx2h+zvFwIgTLzaqbewH2J6jlJ1OTOpd/DWMorEGOPs8mtq5a29q7I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21004},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"c02481e03119e9895720869dfa69e8e3cc008f87","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c rollup.config.mjs"},"_npmUser":{"name":"aquibbaig","email":"aquibbaig97@gmail.com"},"repository":{"url":"git+https://github.com/aquibbaig/spotify-connect.git","type":"git"},"_npmVersion":"10.8.2","description":"Get useful analytics from the spotify API in your React app","directories":{},"_nodeVersion":"20.15.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"react":"^18.2.0","tslib":"^2.7.0","rollup":"^4.21.2","react-dom":"^18.3.1","typescript":"^5.3.2","@types/node":"^20.8.7","@types/react":"^18.2.29","rollup-plugin-dts":"^6.1.1","@rollup/plugin-terser":"^0.4.4","rollup-plugin-cleaner":"^1.0.0","@rollup/plugin-replace":"^5.0.7","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-typescript":"^11.1.6","rollup-plugin-typescript2":"^0.36.0","@rollup/plugin-node-resolve":"^15.2.3","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":"^18.2.0"},"_npmOperationalInternal":{"tmp":"tmp/spotify-connect_1.3.0_1726726418215_0.11375699029296227","host":"s3://npm-registry-packages"}},"1.4.0":{"name":"spotify-connect","version":"1.4.0","keywords":["spotify","nextjs","rfc","playlist"],"author":{"name":"Aquib Baig"},"license":"MIT","_id":"spotify-connect@1.4.0","maintainers":[{"name":"aquibbaig","email":"aquibbaig97@gmail.com"}],"homepage":"https://github.com/aquibbaig/spotify-connect#readme","bugs":{"url":"https://github.com/aquibbaig/spotify-connect/issues"},"dist":{"shasum":"f8f2c588aac52476aabce5c97dae837e10ebefb6","tarball":"https://registry.npmjs.org/spotify-connect/-/spotify-connect-1.4.0.tgz","fileCount":14,"integrity":"sha512-Be3+ae3bO9wB9VVPK5Kj1ZI03oPBifuPaSQhc+EivFoARlqsnzosKxLqhzkTsNvg0jU29oxG9hfIjyWI8ZZSuw==","signatures":[{"sig":"MEUCIQCraRw3IibD43QgwNkWKlSCksKlYU0r/rXcDZbkOx/4ygIge14XlIdWDHKcxcOivGQuXZEoD8jkcA64JRleKugULVE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":21004},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"3b63920724dc05266b17d399eec29e59ba72439a","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c rollup.config.mjs"},"_npmUser":{"name":"aquibbaig","email":"aquibbaig97@gmail.com"},"repository":{"url":"git+https://github.com/aquibbaig/spotify-connect.git","type":"git"},"_npmVersion":"10.8.2","description":"Get useful analytics from the spotify API in your React app","directories":{},"_nodeVersion":"20.15.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"react":"^18.2.0","tslib":"^2.7.0","rollup":"^4.21.2","react-dom":"^18.3.1","typescript":"^5.3.2","@types/node":"^20.8.7","@types/react":"^18.2.29","rollup-plugin-dts":"^6.1.1","@rollup/plugin-terser":"^0.4.4","rollup-plugin-cleaner":"^1.0.0","@rollup/plugin-replace":"^5.0.7","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-typescript":"^11.1.6","rollup-plugin-typescript2":"^0.36.0","@rollup/plugin-node-resolve":"^15.2.3","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":"^18.2.0"},"_npmOperationalInternal":{"tmp":"tmp/spotify-connect_1.4.0_1726729141223_0.8919509180190823","host":"s3://npm-registry-packages"}},"1.5.0":{"name":"spotify-connect","version":"1.5.0","keywords":["spotify","nextjs","rfc","playlist"],"author":{"name":"Aquib Baig"},"license":"MIT","_id":"spotify-connect@1.5.0","maintainers":[{"name":"aquibbaig","email":"aquibbaig97@gmail.com"}],"homepage":"https://github.com/aquibbaig/spotify-connect#readme","bugs":{"url":"https://github.com/aquibbaig/spotify-connect/issues"},"dist":{"shasum":"fd2152eb49deb7df34e85a979636350d8409b2ec","tarball":"https://registry.npmjs.org/spotify-connect/-/spotify-connect-1.5.0.tgz","fileCount":15,"integrity":"sha512-HEb0aQH5+h2s4Vb/fDMh22mEda1KXkPJtAQzQt7t3b7rsftGEOp6oTFvp6JBcWeNQKDcs36LU7QKsRp8ZngY+w==","signatures":[{"sig":"MEUCIGK4xDY7tCv1psAbnpHy4N27PlwAbvpE3lFGsTah/eHIAiEAgbVnHCdcxSVPY4b1Zg3euRKgOrewQq/3hWrzCk97EwM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25102},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"da189adc28370adb9d9f23ab0648e6032d5c6825","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c rollup.config.mjs"},"_npmUser":{"name":"aquibbaig","email":"aquibbaig97@gmail.com"},"repository":{"url":"git+https://github.com/aquibbaig/spotify-connect.git","type":"git"},"_npmVersion":"10.8.2","description":"Get useful analytics from the spotify API in your React app","directories":{},"_nodeVersion":"20.15.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"react":"^18.2.0","tslib":"^2.7.0","rollup":"^4.21.2","react-dom":"^18.3.1","typescript":"^5.3.2","@types/node":"^20.8.7","@types/react":"^18.2.29","rollup-plugin-dts":"^6.1.1","@rollup/plugin-terser":"^0.4.4","rollup-plugin-cleaner":"^1.0.0","@rollup/plugin-replace":"^5.0.7","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-typescript":"^11.1.6","rollup-plugin-typescript2":"^0.36.0","@rollup/plugin-node-resolve":"^15.2.3","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":"^18.2.0"},"_npmOperationalInternal":{"tmp":"tmp/spotify-connect_1.5.0_1726744010272_0.5084480772103355","host":"s3://npm-registry-packages"}},"1.6.0":{"name":"spotify-connect","version":"1.6.0","keywords":["spotify","nextjs","rfc","playlist"],"author":{"name":"Aquib Baig"},"license":"MIT","_id":"spotify-connect@1.6.0","maintainers":[{"name":"aquibbaig","email":"aquibbaig97@gmail.com"}],"homepage":"https://github.com/aquibbaig/spotify-connect#readme","bugs":{"url":"https://github.com/aquibbaig/spotify-connect/issues"},"dist":{"shasum":"bbbaf73f2928ad1f723745c775d80c15258c75e9","tarball":"https://registry.npmjs.org/spotify-connect/-/spotify-connect-1.6.0.tgz","fileCount":15,"integrity":"sha512-q+bzuXmbK69lqJPhh3I8U4aSoiwbaV1yuJo2GjB8JQLSeerZdfx7LD4Xf6tVENjlP/gZ3+gzsIltg1kt3B7PpA==","signatures":[{"sig":"MEUCIAvikn8ro/2hw7pFbmt8HAQdwHtm8ivuDGLeAm9EHnWPAiEA7ZNDp9KBYca0s48TzR7xwyAtlKpGeUl86NpPwJjXq5o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":25410},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","gitHead":"6764673a9fb1f03f40efd311ebf899ebb766e0f3","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c rollup.config.mjs"},"_npmUser":{"name":"aquibbaig","email":"aquibbaig97@gmail.com"},"repository":{"url":"git+https://github.com/aquibbaig/spotify-connect.git","type":"git"},"_npmVersion":"10.8.2","description":"Get useful analytics from the spotify API in your React app","directories":{},"_nodeVersion":"20.15.1","dependencies":{},"_hasShrinkwrap":false,"devDependencies":{"react":"^18.2.0","tslib":"^2.7.0","rollup":"^4.21.2","react-dom":"^18.3.1","typescript":"^5.3.2","@types/node":"^20.8.7","@types/react":"^18.2.29","rollup-plugin-dts":"^6.1.1","@rollup/plugin-terser":"^0.4.4","rollup-plugin-cleaner":"^1.0.0","@rollup/plugin-replace":"^5.0.7","@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-typescript":"^11.1.6","rollup-plugin-typescript2":"^0.36.0","@rollup/plugin-node-resolve":"^15.2.3","rollup-plugin-peer-deps-external":"^2.2.4"},"peerDependencies":{"react":"^18.2.0"},"_npmOperationalInternal":{"tmp":"tmp/spotify-connect_1.6.0_1726772460961_0.7911179195990949","host":"s3://npm-registry-packages"}},"1.7.0":{"name":"spotify-connect","description":"Get useful analytics from the spotify API in your React app","version":"1.7.0","main":"./dist/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build":"rollup -c rollup.config.mjs","test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/aquibbaig/spotify-connect.git"},"keywords":["spotify","nextjs","rfc","playlist"],"author":{"name":"Aquib Baig"},"license":"MIT","bugs":{"url":"https://github.com/aquibbaig/spotify-connect/issues"},"homepage":"https://github.com/aquibbaig/spotify-connect#readme","dependencies":{},"devDependencies":{"@rollup/plugin-commonjs":"^26.0.1","@rollup/plugin-node-resolve":"^15.2.3","@rollup/plugin-replace":"^5.0.7","@rollup/plugin-terser":"^0.4.4","@rollup/plugin-typescript":"^11.1.6","@types/react":"^18.2.29","react-dom":"^18.3.1","rollup":"^4.21.2","rollup-plugin-cleaner":"^1.0.0","rollup-plugin-dts":"^6.1.1","rollup-plugin-peer-deps-external":"^2.2.4","rollup-plugin-typescript2":"^0.36.0","tslib":"^2.7.0","typescript":"^5.3.2","@types/node":"^20.8.7","react":"^18.2.0"},"peerDependencies":{"react":"^18.2.0"},"_id":"spotify-connect@1.7.0","gitHead":"dff55c7959d48bfe7fb9a611061dabb8273ba714","_nodeVersion":"20.15.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-QOYo03D8/j15X0p7pk7B7xyJ+pTs6Xld6q33Zyc/uMrBcpBcBPkbu5AXUOgHoIINvrQC7yDft/HpGeoEfG6p9g==","shasum":"d7b194ce7314d56771d7451ef1855f4b51588e1d","tarball":"https://registry.npmjs.org/spotify-connect/-/spotify-connect-1.7.0.tgz","fileCount":15,"unpackedSize":25394,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAgF4/2H0c9NTJZHaz3bq9PjgcAZdyXfcNJNUfGF0sx6AiBXt0UABiVzku8AyHql28Py8JUSotrG7WEWITkhI+lJyw=="}]},"_npmUser":{"name":"aquibbaig","email":"aquibbaig97@gmail.com"},"directories":{},"maintainers":[{"name":"aquibbaig","email":"aquibbaig97@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/spotify-connect_1.7.0_1726772869339_0.6139364873891677"},"_hasShrinkwrap":false}},"time":{"created":"2023-10-20T06:41:36.179Z","modified":"2024-09-19T19:07:49.775Z","0.0.1":"2021-09-03T07:15:12.037Z","0.0.2":"2021-09-03T21:20:42.289Z","0.0.3":"2021-09-03T21:28:57.393Z","0.0.4":"2021-09-03T21:30:04.663Z","0.0.5":"2021-09-03T21:34:55.720Z","0.0.6":"2021-09-03T21:40:27.612Z","0.0.7":"2021-09-03T21:50:46.821Z","0.0.8":"2021-09-03T21:56:48.192Z","0.0.9":"2021-09-03T21:59:26.678Z","0.1.0":"2021-09-03T22:18:11.324Z","0.1.1":"2021-09-03T22:21:52.235Z","0.1.2":"2021-09-03T22:24:41.986Z","0.1.3":"2021-09-03T22:30:09.020Z","0.1.4":"2021-09-03T22:30:46.558Z","0.1.5":"2021-09-04T02:14:48.201Z","0.1.6":"2021-09-04T02:41:33.232Z","0.1.7":"2021-09-04T02:50:35.768Z","0.1.8":"2021-09-04T02:53:15.912Z","0.1.9":"2021-09-04T03:57:56.247Z","0.2.1":"2021-09-04T04:37:14.332Z","0.2.2":"2021-09-04T04:39:02.195Z","0.2.3":"2021-09-04T04:47:08.045Z","0.2.4":"2021-09-04T05:01:45.462Z","0.2.5":"2021-09-04T05:06:34.938Z","0.2.6":"2021-09-04T05:08:54.079Z","1.0.0":"2023-10-18T18:35:55.681Z","1.1.0":"2023-10-20T06:41:36.389Z","1.2.0":"2023-11-28T06:29:01.114Z","1.3.0":"2024-09-19T06:13:38.391Z","1.4.0":"2024-09-19T06:59:01.346Z","1.5.0":"2024-09-19T11:06:50.435Z","1.6.0":"2024-09-19T19:01:01.169Z","1.7.0":"2024-09-19T19:07:49.615Z"},"bugs":{"url":"https://github.com/aquibbaig/spotify-connect/issues"},"author":{"name":"Aquib Baig"},"license":"MIT","homepage":"https://github.com/aquibbaig/spotify-connect#readme","keywords":["spotify","nextjs","rfc","playlist"],"repository":{"type":"git","url":"git+https://github.com/aquibbaig/spotify-connect.git"},"description":"Get useful analytics from the spotify API in your React app","maintainers":[{"name":"aquibbaig","email":"aquibbaig97@gmail.com"}],"readme":"# spotify-connect\n\nIntegrate Spotify analytics into your React application to provide real-time analytics.\nThis guide demonstrates how to use the Spotify API to retrieve and parse data on the currently playing track in your React or React Server Components application.\n\n```\nnpm i spotify-connect\n```\n\n## Currently supported APIs\n\n- **Get currently playing track:** Retrieve information about the track currently being played by a Spotify user.\n\n  - Endpoint: [https://api.spotify.com/v1/me/player/currently-playing](https://api.spotify.com/v1/me/player/currently-playing)\n\n- **Get recently played tracks:** Retrieve the list of recently played tracks of a Spotify user.\n  - Endpoint: [`https://api.spotify.com/v1/me/player/recently-played`](https://api.spotify.com/v1/me/player/recently-played)\n\n## Requirements\n\nTo get started, you'll need the following:\n\n- **client_id:** Spotify app client ID\n- **client_secret:** Spotify app client secret\n- **refresh_token:** Spotify app refresh token. You can generate one as explained in various articles on the web. [Example](https://medium.com/@benwiz/how-to-create-a-spotify-refresh-token-the-easy-way-b41a66c7fdd4)\n\n## Available Response Data Parsing Methods\n\nThe response from the Spotify API can be parsed using the following method:\n\n```javascript\nparseCurrentTrack(data)\n\nReturns:\n{\n  track: {\n    id: item.id,\n    name: item.name,\n    artist: item.artists,\n    album: item.album.name,\n    image: item.album.images[0].url,\n    duration: item.duration_ms,\n    progress: progress_ms,\n    uri: item.uri,\n  },\n  timestamp,\n}\n```\n\n## Usage\n\n1. In the root of your application or wherever you want to use spotify-connect utilities, import the `SpotifyConnectContextProvider`.\n\n```javascript\n<SpotifyConnectContextProvider\n  clientId={SPOTIFY_CLIENT_ID}\n  clientSecret={SPOTIFY_CLIENT_SECRET}\n  refreshToken={SPOTIFY_REFRESH_TOKEN}\n>\n```\n\n2. Now you can use the utilities in your components as follows.\n\n```javascript\n  const { data } = useCurrentTrack()\n\n  options: {\n    refetchInterval: (milliseconds, default = 5000 or 5seconds)\n  }\n```\n","readmeFilename":"README.md"}