| Option | Description |
plugin_music
|
Enable music plugin
![]() |
๐ Web instances must configure settings.json:
- metrics.run.puppeteer.scrapping
type: boolean
default: no
|
plugin_music_provider
|
Music provider
apple: Apple Music
spotify: Spotify
lastfm: Last.fm
youtube: YouTube Music
This setting is optional when using plugin_music_mode: playlist (provider will be auto-detected from plugin_music_playlist URL)
![]() |
type: string
allowed values:- apple
- spotify
- lastfm
- youtube
|
plugin_music_token
|
Music provider token
Below is the expected token format for each provider:
apple: (not supported)
spotify: "client_id, client_secret, refresh_token"
lastfm: "api_key"
youtube: "cookie"
![]() |
๐ Token
type: token
|
plugin_music_user
|
Music provider username
![]() |
โฏ๏ธ Cannot be preset
type: string
default: โ User login
|
plugin_music_mode
|
Display mode
playlist: display random tracks from an URL playlist
recent: display recently listened tracks
top: display top listened artists/tracks
If plugin_music_playlist is specifed, the default value is playlist, else it is recent
![]() |
type: string
allowed values: |
plugin_music_playlist
|
Playlist URL
It must be from an "embed url" (i.e. music player iframes that can be integrated in other websites)
![]() |
โฏ๏ธ Cannot be preset
type: string
|
plugin_music_limit
|
Display limit
![]() |
type: number
(1 โค
๐ฅ
โค 100)
default: 4
|
plugin_music_played_at
|
Recently played - Last played timestamp
![]() |
type: boolean
default: no
|
plugin_music_time_range
|
Top tracks - Time range
short: 4 weeks
medium: 6 months
long: several years
![]() |
type: string
default: short
allowed values: |
plugin_music_top_type
|
Top tracks - Display type
tracks: display track
artists: display artists
![]() |
type: string
default: tracks
allowed values: |
## ๐บ Configuring music provider
Select a music provider below for additional instructions.
## ๐๏ธ Spotify
### ๐๏ธ Obtaining a token
Spotify does not have *personal tokens*, so it makes the process a bit longer because it is required to follow the [authorization workflow](https://developer.spotify.com/documentation/general/guides/authorization-guide/)... Follow the instructions below for a *TL;DR* to obtain a `refresh_token`.
Sign in to the [developer dashboard](https://developer.spotify.com/dashboard/) and create a new app.
Keep your `client_id` and `client_secret` and let this tab open for now.

Open the settings and add a new *Redirect url*. Normally it is used to setup callbacks for apps, but just put `https://localhost` instead (it is mandatory as per the [authorization guide](https://developer.spotify.com/documentation/general/guides/authorization-guide/), even if not used).
Forge the authorization url with your `client_id` and the encoded `redirect_uri` you whitelisted, and access it from your browser:
```
https://accounts.spotify.com/authorize?client_id=********&response_type=code&scope=user-read-recently-played%20user-top-read&redirect_uri=https%3A%2F%2Flocalhost
```
When prompted, authorize application.

Once redirected to `redirect_uri`, extract the generated authorization `code` from your url bar.

Go back to developer dashboard tab, and open the web console of your browser to paste the following JavaScript code, with your own `client_id`, `client_secret`, authorization `code` and `redirect_uri`.
```js
(async () => {
console.log(await (await fetch("https://accounts.spotify.com/api/token", {
method:"POST",
headers:{"Content-Type":"application/x-www-form-urlencoded"},
body:new URLSearchParams({
grant_type:"authorization_code",
redirect_uri:"https://localhost",
client_id:"********",
client_secret:"********",
code:"********",
})
})).json())
})()
```
It should return a JSON response with the following content:
```json
{
"access_token":"********",
"expires_in": 3600,
"scope":"user-read-recently-played user-top-read",
"token_type":"Bearer",
"refresh_token":"********"
}
```
Register your `client_id`, `client_secret` and `refresh_token` in secrets to finish setup.
### ๐ Get an embed playlist url for `plugin_music_playlist`
Connect to [spotify.com](https://www.spotify.com) and select the playlist you want to share.
From `...` menu, select `Share` and `Copy embed code`.

Extract the source link from the code pasted in your clipboard:
```html