A monorepo for open source music tooling, with the Spotify Web API SDK as one product in the spotify-effect family.
This is an isomorphic (works in both Node.js and browser environments) Effect-based wrapper around the Spotify Web API, inspired by spotify-web-api-ts. It provides:
- Type-safe API calls with full TypeScript support
- Functional error handling using Effect's composable error management
- Built-in retries & batching via Effect's request resolvers
- OpenTelemetry tracing for observability (optional, via
SPOTIFY_EFFECT_TRACE=1) - PKCE OAuth flow support for browser-based authentication
- Comprehensive test coverage with Vitest
@spotify-effect/core— Core SDK with API clients, auth flows, and shared helpers@spotify-effect/browser— Browser-focused package with PKCE/session helpers andSpotifyBrowser@spotify-effect/otel-node— Node OpenTelemetry integration
examples/basic— Node.js example with tracingexamples/browser— Browser-based PKCE authentication flowexamples/otel— Ready-to-run OpenTelemetry collector stack
import { makeSpotifyLayer, Tracks } from "@spotify-effect/core";
import { Effect } from "effect";
const program = Effect.gen(function* () {
const tracks = yield* Tracks;
const track = yield* tracks.getTrack("4iV5W9uYEdYUVa79Axb7Rh");
return track;
}).pipe(Effect.provide(makeSpotifyLayer({}, { accessToken: "your-access-token" })));
Effect.runPromise(program);Request and auth flows emit Effect tracing spans at shared boundaries. Enable local tracing with SPOTIFY_EFFECT_TRACE=1. See docs/tracing/otel.md for setup notes and examples/otel/ for a ready-to-run collector stack.
See docs/ for more detailed documentation.