Questions tagged [apple-musickit-js]
17 questions
5
votes
1 answer
Use token from "sign in with apple" to query apple music api
Context
I am trying to make webservice that fetches the name and email from an users Apple account and place a Song or Artist in his library.
For adding a Song to the library I found this apple-music-api. library. To make requests on behalf of a…

Florian
- 725
- 6
- 27
5
votes
2 answers
Do Apple Music User Tokens expire?
I'm working on integrating Apple Music into my web app. I let users authenticate once, using Apple's MusicKit JS. However, I'm curious if the resulting Music User Token expires. I'm storing this token in a database, but I need to know if I can use…

Niels Kersic
- 830
- 1
- 9
- 24
2
votes
0 answers
Authorize to Apple Music via Facebook Messenger In-App Browser
We're using https://developer.apple.com/documentation/musickitjs to authorize Apple music, on Desktop it opens a new window to authorize to apple.
But It's NOT working on mobile In-App Browser (both iOS & Android), probably because on mobile…

Ashish Chaturvedi
- 1,352
- 3
- 13
- 37
2
votes
1 answer
Can I get a user's display name from Apple MusicKit?
I've been going through Apple's (awful) documentation for both MusicKit, the API and MusicKit JS, but I haven't been able to find an endpoint or method to retrieve a user's display name, email or any other information that I can use to identify the…

Niels Kersic
- 830
- 1
- 9
- 24
2
votes
0 answers
Make use of recently played songs endpoint on Apple Music
I would like to make use of the "Get Recently Played Resources" endpoint of the Apple Music API.
More specifically, I would like to keep track of how often a user has listened to a specific song/album.
As of right now, I am not quite convinced if…

linus_hologram
- 1,595
- 13
- 38
1
vote
1 answer
Error when authenticate MusicKit instance
whenever I try to authenticate a MusicKit instance the popup alway shows 'Problem Connecting There may be a network issue. '. When reloading the popup it shows the login screen, but after I did log in it shows the same error page again.
On the first…

CptCookie
- 11
- 3
1
vote
2 answers
Using Promise and await instead of then()
I'm using MusicKit-JS and while this code works I don't know if there's another way of writing it.
The music methods themselves all return __awaiter(...).
Is there a way to write this using promises? I don't know much about them so couldn't get it…

Omar.Ebrahim
- 862
- 1
- 10
- 30
1
vote
0 answers
What resource types are supported by MusicKIt addToLibrary function?
My code for adding songs to user's music library looks like this:
let kit = MusicKit.getInstance();
kit.authorize()
.then(() => {
kit.addToLibrary('1234567', 'SONGS');
});
Do you know what other types, besides SONGS, are supported?…

naXa stands with Ukraine
- 35,493
- 19
- 190
- 259
1
vote
1 answer
How to play music using Apple Music Kit JS
I'm trying to create a small player using Apple Music Kit JS but I'm having issues when playing the song.
This is my current code:
Hear for…

Ethan Lipnik
- 21
- 2
0
votes
0 answers
How to get Music-user-token for apple music in nodejs
I am creating a React-Native application with Nodejs on backend.
My app has a feature to link apple music account with my app.
for this, I need to have Music-user-token of particular user who has joined my app and for Music-user-token, I need user's…

zohran rasheed
- 1
- 2
0
votes
1 answer
Apple MusicKit JS authorization method doesn't resolve
I'm building a Django application where I'm using Apple's MusicKit JS to authorize users and get their music library songs. I've correctly set up the MusicKit configuration in my HTML, and I am just doing this locally for testing purposes right…

Drew Graham
- 1
- 1
0
votes
0 answers
Typescript definition file - for a function, return actual property types, or custom property type itself?
I'm trying to write a TypeScript type definitions file for an external JS library, MusicKit JS. I'm fairly new to TS (and especially declaring type definitions in TS). The MusicKit docs are, at times, not very descriptive, and I'd like to avoid…

Scarlet
- 1
- 2
0
votes
3 answers
How to recursive Promises in a loop and passing argument to another
I've checked other threads on SO but none really answers the questions as each answer ommiting something necessary for my case, and none of it is for Apple Music. Apple API is heavily promise-based and even async/await returns promise instead of…

Sebastian
- 448
- 4
- 14
0
votes
1 answer
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…

emw2006
- 1
0
votes
1 answer
Apple's MusicKit JS library example runs fine when rendered by Node.js, fails with Django
For three hours, I've been scratching my head over this.
Apple's MusicKit uses JWT tokens to authenticate.
When I npm start this Node.js example project, I can generate the JWT token, and then authorize Apple Music and collect the user token in…

gwizzo
- 49
- 8