MusicKit JS

RSS for tag

Add an Apple Music player to your web app using MusicKit JS.

Posts under MusicKit JS tag

123 Posts

Post

Replies

Boosts

Views

Activity

musickit js albums undefined for user
I am trying to get the list of albums from a user's library. I use this code. The user is able to successfully login but the albums property of the library object is undefined. How do I get the list of albums for a user? music.authorize().then(function() { music.api.library.albums.then(function(cloudAlbums) { // user's cloudAlbums console.log('cloudAlbums'); }); });
1
0
749
Oct ’21
Where do i put the user token for api request
i have this sample code to get the users albums, but where do i put the usertoken on the request.get call. I can't find anywhere online that shows where it goes. "use strict"; const fs = require("fs"); const jwt = require("jsonwebtoken"); const request = require("request"); const privateKey = fs.readFileSync("AuthKey.p8").toString(); const jwtToken = jwt.sign({}, privateKey, { algorithm: "ES256", expiresIn: "180d", issuer: "", header: { alg: "ES256", kid: "" } }); console.log("token:", jwtToken, "\n"); var url = ""; url = "https://api.music.apple.com/v1/me/library/albums"; request.get( { url: url, auth: { bearer: jwtToken }, json: true }, (err, httpResponse, body) => { if (err) { console.error(err); } else { console.log(body.results.albums.data); } } );
1
0
1k
Oct ’21
Tinder app creation
Hi guys, I'm trying to build an app that functions similarly to tinder and i'm asking for some tips on that creation. I just need some brainstorm ideas of how to best create a dating swipe type app like tinder? Does anyone have any ideas on how tinder was created? How many view controllers, which is the best view controller to use/create? anything would be helpful!
1
0
949
Oct ’21
musickit js albums undefined for user
I am trying to get the list of albums from a user's library. I use this code. The user is able to successfully login but the albums property of the library object is undefined. How do I get the list of albums for a user? music.authorize().then(function() { music.api.library.albums.then(function(cloudAlbums) { // user's cloudAlbums console.log('cloudAlbums'); }); });
Replies
1
Boosts
0
Views
749
Activity
Oct ’21
Where do i put the user token for api request
i have this sample code to get the users albums, but where do i put the usertoken on the request.get call. I can't find anywhere online that shows where it goes. "use strict"; const fs = require("fs"); const jwt = require("jsonwebtoken"); const request = require("request"); const privateKey = fs.readFileSync("AuthKey.p8").toString(); const jwtToken = jwt.sign({}, privateKey, { algorithm: "ES256", expiresIn: "180d", issuer: "", header: { alg: "ES256", kid: "" } }); console.log("token:", jwtToken, "\n"); var url = ""; url = "https://api.music.apple.com/v1/me/library/albums"; request.get( { url: url, auth: { bearer: jwtToken }, json: true }, (err, httpResponse, body) => { if (err) { console.error(err); } else { console.log(body.results.albums.data); } } );
Replies
1
Boosts
0
Views
1k
Activity
Oct ’21
Tinder app creation
Hi guys, I'm trying to build an app that functions similarly to tinder and i'm asking for some tips on that creation. I just need some brainstorm ideas of how to best create a dating swipe type app like tinder? Does anyone have any ideas on how tinder was created? How many view controllers, which is the best view controller to use/create? anything would be helpful!
Replies
1
Boosts
0
Views
949
Activity
Oct ’21