npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

sextify

v1.0.9

Published

Spotify API client capable of logging in with user accounts and downloading

Readme

Sextify

Spotify API client capable of logging in with user accounts and downloading

  • AAC fully supported
  • OGG does not work, but it's properly supported and implemented and will work with proper DRM keys

Dependencies

Usage

npm install --save sextify
import { SpotifyApi } from "sextify";

// yes, no auth required, this line actually works (by getting a public shared cookie)
const s = await SpotifyApi.withClientApplication()

await s.tracks.fetch("3pkXNBtkg8E2xRAKrnu43s", "./test.m4a");          // download

s.tracks.fetch("3pkXNBtkg8E2xRAKrnu43s", {ffmpeg: {format: "mpegts"}}) // stream
        .then(r=>r.pipe(...))      

Authentication

You can (and should) import your own sp_dc cookie from your browser to use with your own account, library, algorithms, etc.

sp_t cookie is only required for pathfinder.home endpoint, so you probably won't need it.

await SpotifyApi.withClientApplication({
    // use either cookies or token
    cookies: "sp_dc=12345; sp_t=54321",

    // optional if cookies are set, but recommended to avoid authenticating every time; otherwise required
    // accessToken usually expires in a hour, and is refreshed with proper cookies
    token: {                            
        accessToken: "12345",
        accessTokenExpirationTimestampMs: 1234567890
    },

    // optional, same as token, except only required for pathfinder, lyrics, inspiredBy endpoints
    clientToken: {
        token: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
        refresh_after_seconds: 1234560690
    }
})

Widevine DRM (AAC)

Public device keys are used by default and seem to work perfectly, but you can provide your own if you want:

  1. Use KeyDive and any rooted Android device
  2.  await SpotifyApi.withClientApplication({
         /// ...
         widevineDevice: parseWidevineDevice(await readFile("./oneplus_cph2585_16.0.1@007_756dffe2_29559_l3.wvd"))
     })

PlayPlay DRM (OGG)

Neither keys or unplayplay are shipped with the library, but if you manage to get them:

import unplayplay from "unplayplay";

await SpotifyApi.withClientApplication({
    /// ...
    unplayplay
})