A plugin to play specific tracks on your Spotify device directly from Obsidian.
- Embed links to Spotify tracks, playlists, or albums in your notes as convenient buttons.
- On button click, your Spotify device/client will play this track (or playlist).
- OAuth PKCE flow.
This plugin does not play music by itself, it only controls your Spotify player via WebAPI Unfortunately, these API functions are only available for premium Spotify subscribers. You will also need to create your own Spotify app, although it's quite easy to do at the moment.
- Ensure you have Premium Spotify subscription
- Create your Spotify app at the Spotify Developer Dashboard.
- Note down your
client_idandclient_secret. - Configure the app's redirect URI to
obsidian://obsidian-spotiplay.
- Open your vault's plugins folder (
.obsidian/plugins). - Clone the repository:
git clone https://github.com/aa333/obsidian-spotiplay.git - Enable the plugin in Obsidian settings.
Add a code block in your note with the spotiplayer language tag and following format:
```spotiplayer
label: Tavern Theme
uri: spotify:track:2uFaJJtFpPDc5Pa95XzTvg
```
label: The button label.uri: The Spotify URI for a track, playlist, or album. No quotes,spotify:prefix required. Example: https://open.spotify.com/track/0NNCkIadCP6VnV7LeGL1zx will turn intospotify:track:0NNCkIadCP6VnV7LeGL1zx
Click the button. Browser window will open - allow access to your account and redirect back to Obsidian. Your music should play.
- Install Node (https://nodejs.org/)
- Enable Corepack to automatically handle package managers
Or, alternatively, install pnpm manually:
corepack enable && corepack enable npmnpm install pnpm -g - Install libraries
pnpm install - Run in watch mode:
pnpm dev - Use hot-reload for automatic plugin reloads, or reload plugin manually in Obsidian.
Feel free to submit issues or pull requests for improvements or bug fixes.
This project is licensed under the MIT License.