server
For Node, Cloudflare Workers, Bun and Deno. Signs its own developer token, and hands your pages one.
Open and community-led. A typed function for nearly every endpoint, tokens that look after themselves, and packages for servers, web pages and React.
doctor tells you whether Apple takes it.login. See The command-line tool.server, browser or react, is the shortest.On your server, with your MusicKit key:
import { createServerClient } from "@open-music-sdk/server";
const music = createServerClient({
pem: process.env.APPLE_MUSIC_PRIVATE_KEY!,
teamId: process.env.APPLE_MUSIC_TEAM_ID!,
keyId: process.env.APPLE_MUSIC_KEY_ID!,
storefront: "us",
});
const album = await music.catalog.getAlbum("1613600183");
console.log(album.attributes?.name);