Only this pageAll pages
Powered by GitBook
1 of 28

Cider Docs

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

RPC Documentation

Documentation for RPC API endpoints accessible by clients external to Cider.

Hostname and Port

All API endpoints are accessible at http://localhost:10767.

We've observed that using 127.0.0.1 when IPv4 is disabled tends to break and not connect. We recommend you do not turn off IPv4, but if you are required to do so, try using [::1]:10767.

Authentication

Unless explicitly disabled within Cider, all API requests require a valid API token. You can generate this token, or turn off authentication, from the menu at Settings -> Connectivity -> Manage External Application Access to Cider within Cider.

The generated token should be passed in the apitoken header of all requests. Do not prefix the token with Bearer or any other string; just pass the token by itself in the header.

This token is not required if disabled within the settings menu.

/api/v1/playback

The API endpoints documented below are all nested under /api/v1/playback.

GET /active

Responds with an empty body and status code 204: No Content. This endpoint can be used to quickly check that the RPC server is still active.

204: No Content

// No response body...

GET /is-playing

Responds with a boolean value indicating whether music is currently playing.

200: OK
{
  "status": "ok",
  "is_playing": true
}

GET /now-playing

Responds with an Apple Music API response for the currently playing song.

200: OK
{
  "status": "ok",
  "info": {
    "albumName": "Skin",
    "hasTimeSyncedLyrics": true,
    "genreNames": [
      "Electronic"
    ],
    "trackNumber": 14,
    "durationInMillis": 193633,
    "releaseDate": "2016-05-27T12:00:00Z",
    "isVocalAttenuationAllowed": true,
    "isMasteredForItunes": false,
    "isrc": "AlligatorAUFF01600807",
    "artwork": {
      "width": 600,
      "height": 600,
      "url": "https://is1-ssl.mzstatic.com/image/thumb/Music116/v4/0e/d9/af/0ed9af7b-595d-6e9f-7b2e-c1113f4902f6/3555.jpg/640x640sr.jpg"
    },
    "audioLocale": "en-US",
    "url": "https://music.apple.com/ca/album/like-water-feat-mndr/1719860281?i=1719861213",
    "playParams": {
      "id": "1719861213",
      "kind": "song"
    },
    "discNumber": 1,
    "hasLyrics": true,
    "isAppleDigitalMaster": false,
    "audioTraits": [
      "atmos",
      "lossless",
      "lossy-stereo",
      "spatial"
    ],
    "name": "Like Water (feat. MNDR)",
    "previews": [
      {
        "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview116/v4/33/68/51/336851f3-f985-9948-a4dc-579c57b1f326/mzaf_16966411213881300046.plus.aac.ep.m4a"
      }
    ],
    "artistName": "Flume",
    "currentPlaybackTime": 2.066576,
    "remainingTime": 191.566424,
    "inFavorites": false,
    "inLibrary": false,
    "shuffleMode": 0,
    "repeatMode": 0
  }
}

POST /play-url

Triggers playback of an item.

Accepts a url of the item to play. This URL can be found by right-clicking on an item and clicking on Share -> Apple Music in Cider, Share -> Copy Link in the official Apple Music app, or by copying the URL when viewing an item in the Apple Music web app.

Request Body (`application/json`)
{
  "url": "https://music.apple.com/ca/album/like-water-feat-mndr/1719860281"
}
200: OK
{
  "status": "ok"
}

POST /play-item-href

Triggers playback of an item.

Accepts an href (Apple Music API identifier).

Request Body (`application/json`)
{
  "href": "/v1/catalog/ca/songs/1719861213"
}
200: OK
{
  "status": "ok"
}

POST /play-item

Triggers playback of an item.

Accepts a type of item to play and an id for the item. type should be one of the accepted types in the Apple Music API, such as songs. Note that the ID is required to be a string, not a number.

Request Body (`application/json`)
{
  "type": "songs",
  "id": "1719861213"
}
200: OK
{
  "status": "ok"
}

POST /play-later

Adds an item to the end of the play queue (played after all other items currently in the queue).

Accepts a type of item to play and an id for the item. type should be one of the accepted types in the Apple Music API, such as songs. Note that the ID is required to be a string, not a number.

Request Body (`application/json`)
{
  "type": "songs",
  "id": "1719861213"
}
200: OK
{
  "status": "ok"
}

POST /play-next

Adds an item to the start of the play queue (played next, before all other items in the queue).

Accepts a type of item to play and an id for the item. type should be one of the accepted types in the Apple Music API, such as songs. Note that the ID is required to be a string, not a number.

Request Body (`application/json`)
{
  "type": "songs",
  "id": "1719861213"
}
200: OK
{
  "status": "ok"
}

POST /play

Resumes playback of the current item. If no item is playing, the behavior set under the menu Settings -> Play Button on Stopped Action in Cider will take effect.

200: OK
{
  "status": "ok"
}

POST /pause

Pauses the currently playing item. If no item is playing or if the item is already paused, this will do nothing.

200: OK
{
  "status": "ok"
}

POST /playpause

Toggles the play/pause state of the current item. This has the same behavior as calling /pause if the item is playing, and /play if the item is paused.

200: OK
{
  "status": "ok"
}

POST /stop

Stops the current playback and removes the current item. If items are in the queue, they will be kept.

200: OK
{
  "status": "ok"
}

POST /next

Moves to the next item in the queue, if any. Autoplay enable/disable status will be respected if the queue is empty (infinity button within the queue panel in Cider).

If no item is currently playing but there is one in the queue, it will be started.

200: OK
{
  "status": "ok"
}

POST /previous

Moves to the previously played item, which is the item most recent in the playback history.

If no item is currently playing but there is one in the playback history, it will be started.

200: OK
{
  "status": "ok"
}

GET /queue

Gets the current queue as a list of Apple Music response objects. Note that this also includes part of the history and the currently playing track.

200: OK
[
  {
    "id": "1440559604",
    "type": "song",
    "assetURL": "https://aod-ssl.itunes.apple.com/itunes-assets/Music116/v4/28/7d/75/287d75f0-ec98-845f-377e-57a5c2c8d0c4/mzaf_A1440559604.rphq.aac.wa.m3u8",
    "hlsMetadata": {},
    "flavor": "28:ctrp256",
    "attributes": {
      "albumName": "Bright Lights (Deluxe Version)",
      "hasTimeSyncedLyrics": true,
      "genreNames": [
        "Pop"
      ],
      "trackNumber": 11,
      "durationInMillis": 210634,
      "releaseDate": "2010-02-26T12:00:00Z",
      "isVocalAttenuationAllowed": true,
      "isMasteredForItunes": false,
      "isrc": "UniversalGBUM71028043",
      "artwork": {
        "width": 600,
        "height": 600,
        "url": "https://is1-ssl.mzstatic.com/image/thumb/Music123/v4/e4/53/c8/e453c827-3858-d5c2-e2a2-1b85d772b0ba/10UMGIM30297.rgb.jpg/640x640sr.jpg"
      },
      "composerName": "Ellie Goulding, Richard Stannard & Ash Howes",
      "audioLocale": "en-US",
      "playParams": {
        "id": "1440559604",
        "kind": "song"
      },
      "url": "https://music.apple.com/ca/album/lights-single-version/1440559376?i=1440559604",
      "discNumber": 1,
      "isAppleDigitalMaster": false,
      "hasLyrics": true,
      "audioTraits": [
        "lossless",
        "lossy-stereo"
      ],
      "name": "Lights (Single Version)",
      "previews": [
        {
          "url": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview126/v4/09/97/f4/0997f41b-abf7-bae9-6059-1637b6a12f6c/mzaf_4696029188384744065.plus.aac.ep.m4a"
        }
      ],
      "artistName": "Ellie Goulding",
      "currentPlaybackTime": 48.994104,
      "remainingTime": 161.639896
    },
    "playbackType": 3,
    "_container": {
      "id": "ra.cp-1055074639",
      "type": "stations",
      "href": "/v1/catalog/ca/stations/ra.cp-1055074639",
      "attributes": {
        "requiresSubscription": true,
        "isLive": false,
        "kind": "songSeeded",
        "radioUrl": "itsradio://music.apple.com/ca/station/ra.cp-1055074639",
        "mediaKind": "audio",
        "name": "Unstoppable Station",
        "artwork": {
          "width": 1500,
          "url": "https://is1-ssl.mzstatic.com/image/thumb/Music115/v4/bc/13/27/bc13275c-8b26-802d-771b-d15ae00fb530/mzm.hvpwjsvi.jpg/{w}x{h}AM.RSSB02.jpg",
          "height": 1500,
          "textColor3": "bda69d",
          "textColor2": "e8c4aa",
          "textColor4": "bca08b",
          "textColor1": "eaccc1",
          "bgColor": "0c0e0d",
          "hasP3": false
        },
        "url": "https://music.apple.com/ca/station/unstoppable-station/ra.cp-1055074639",
        "playParams": {
          "id": "ra.cp-1055074639",
          "kind": "radioStation",
          "format": "tracks",
          "stationHash": "CgkIARoFz9KM9wMQBQ",
          "hasDrm": false,
          "mediaType": 0
        }
      },
      "name": "now_playing"
    },
    "_context": {
      "featureName": "now_playing"
    },
    "_state": {
      "current": 2
    },
    "_songId": "1440559604",
    "assets": [
      {
        "flavor": "30:cbcp256",
        "URL": "https://aod-ssl.itunes.apple.com/itunes-assets/Music116/v4/28/7d/75/287d75f0-ec98-845f-377e-57a5c2c8d0c4/mzaf_A1440559604.cphq.aac.wa.m3u8",
        "downloadKey": "",
        "artworkURL": "https://is1-ssl.mzstatic.com/image/thumb/Music123/v4/e4/53/c8/e453c827-3858-d5c2-e2a2-1b85d772b0ba/10UMGIM30297.rgb.jpg/600x600bb.jpg",
        "file-size": 2228,
        "md5": "151e9fe6106256ef388a4b11dae4a672",
        "chunks": {
          "chunkSize": 0,
          "hashes": []
        },
        "metadata": {
          "composerId": "20844291",
          "genreId": 14,
          "copyright": "℗ 2010 Polydor Ltd. (UK)",
          "year": 2010,
          "sort-artist": "Ellie Goulding",
          "isMasteredForItunes": false,
          "vendorId": 2115541,
          "artistId": "338264227",
          "duration": 210634,
          "discNumber": 1,
          "itemName": "Lights (Single Version)",
          "trackCount": 30,
          "xid": "Universal:isrc:GBUM71028043",
          "bitRate": 256,
          "fileExtension": "m4p",
          "sort-album": "Bright Lights (Deluxe Version)",
          "genre": "Pop",
          "rank": 11,
          "sort-name": "Lights (Single Version)",
          "playlistId": "1440559376",
          "sort-composer": "Ellie Goulding, Richard Stannard & Ash Howes",
          "comments": "(Single Version)",
          "trackNumber": 11,
          "releaseDate": "2010-02-26T12:00:00Z",
          "kind": "song",
          "playlistArtistName": "Ellie Goulding",
          "gapless": false,
          "composerName": "Ellie Goulding, Richard Stannard & Ash Howes",
          "discCount": 1,
          "sampleRate": 44100,
          "playlistName": "Bright Lights (Deluxe Version)",
          "explicit": 0,
          "itemId": "1440559604",
          "s": 143455,
          "compilation": false,
          "artistName": "Ellie Goulding"
        }
      },
      {
        "flavor": "28:ctrp256",
        "URL": "https://aod-ssl.itunes.apple.com/itunes-assets/Music116/v4/28/7d/75/287d75f0-ec98-845f-377e-57a5c2c8d0c4/mzaf_A1440559604.rphq.aac.wa.m3u8",
        "downloadKey": "",
        "artworkURL": "https://is1-ssl.mzstatic.com/image/thumb/Music123/v4/e4/53/c8/e453c827-3858-d5c2-e2a2-1b85d772b0ba/10UMGIM30297.rgb.jpg/600x600bb.jpg",
        "file-size": 2104,
        "md5": "b577b5dd0cd5eef7aabce0b4f52fb7f9",
        "chunks": {
          "chunkSize": 0,
          "hashes": []
        },
        "metadata": {
          "composerId": "20844291",
          "genreId": 14,
          "copyright": "℗ 2010 Polydor Ltd. (UK)",
          "year": 2010,
          "sort-artist": "Ellie Goulding",
          "isMasteredForItunes": false,
          "vendorId": 2115541,
          "artistId": "338264227",
          "duration": 210634,
          "discNumber": 1,
          "itemName": "Lights (Single Version)",
          "trackCount": 30,
          "xid": "Universal:isrc:GBUM71028043",
          "bitRate": 256,
          "fileExtension": "m4p",
          "sort-album": "Bright Lights (Deluxe Version)",
          "genre": "Pop",
          "rank": 11,
          "sort-name": "Lights (Single Version)",
          "playlistId": "1440559376",
          "sort-composer": "Ellie Goulding, Richard Stannard & Ash Howes",
          "comments": "(Single Version)",
          "trackNumber": 11,
          "releaseDate": "2010-02-26T12:00:00Z",
          "kind": "song",
          "playlistArtistName": "Ellie Goulding",
          "gapless": false,
          "composerName": "Ellie Goulding, Richard Stannard & Ash Howes",
          "discCount": 1,
          "sampleRate": 44100,
          "playlistName": "Bright Lights (Deluxe Version)",
          "explicit": 0,
          "itemId": "1440559604",
          "s": 143455,
          "compilation": false,
          "artistName": "Ellie Goulding"
        },
        "previewURL": "https://audio-ssl.itunes.apple.com/itunes-assets/AudioPreview126/v4/09/97/f4/0997f41b-abf7-bae9-6059-1637b6a12f6c/mzaf_4696029188384744065.plus.aac.ep.m4a"
      },
      {
        "flavor": "37:ibhp256",
        "URL": "https://aod-ssl.itunes.apple.com/itunes-assets/Music116/v4/28/7d/75/287d75f0-ec98-845f-377e-57a5c2c8d0c4/mzaf_A1440559604.iphq.aac.wa.m3u8",
        "downloadKey": "",
        "artworkURL": "https://is1-ssl.mzstatic.com/image/thumb/Music123/v4/e4/53/c8/e453c827-3858-d5c2-e2a2-1b85d772b0ba/10UMGIM30297.rgb.jpg/600x600bb.jpg",
        "file-size": 2296,
        "md5": "d54100817096454cb074de4daf3ce322",
        "chunks": {
          "chunkSize": 0,
          "hashes": []
        },
        "metadata": {
          "composerId": "20844291",
          "genreId": 14,
          "copyright": "℗ 2010 Polydor Ltd. (UK)",
          "year": 2010,
          "sort-artist": "Ellie Goulding",
          "isMasteredForItunes": false,
          "vendorId": 2115541,
          "artistId": "338264227",
          "duration": 210634,
          "discNumber": 1,
          "itemName": "Lights (Single Version)",
          "trackCount": 30,
          "xid": "Universal:isrc:GBUM71028043",
          "bitRate": 256,
          "fileExtension": "m4p",
          "sort-album": "Bright Lights (Deluxe Version)",
          "genre": "Pop",
          "rank": 11,
          "sort-name": "Lights (Single Version)",
          "playlistId": "1440559376",
          "sort-composer": "Ellie Goulding, Richard Stannard & Ash Howes",
          "comments": "(Single Version)",
          "trackNumber": 11,
          "releaseDate": "2010-02-26T12:00:00Z",
          "kind": "song",
          "playlistArtistName": "Ellie Goulding",
          "gapless": false,
          "composerName": "Ellie Goulding, Richard Stannard & Ash Howes",
          "discCount": 1,
          "sampleRate": 44100,
          "playlistName": "Bright Lights (Deluxe Version)",
          "explicit": 0,
          "itemId": "1440559604",
          "s": 143455,
          "compilation": false,
          "artistName": "Ellie Goulding"
        }
      }
    ],
    "keyURLs": {
      "hls-key-cert-url": "https://s.mzstatic.com/skdtool_2021_certbundle.bin",
      "hls-key-server-url": "https://play.itunes.apple.com/WebObjects/MZPlay.woa/wa/acquireWebPlaybackLicense",
      "widevine-cert-url": "https://play.itunes.apple.com/WebObjects/MZPlay.woa/wa/widevineCert"
    }
  },
  // ...more items of the same format...
]

POST /queue

Not currently functional.

POST /queue/move-to-position

Moves an item in the queue from the startIndex to the destinationIndex. Optionally returns the queue if passed returnQueue.

Note that the index is 1-indexed (starts at 1, not 0). Also note that the queue contains some items that are from the history, so the items visible in the Up Next view in Cider may start at a number higher than 1.

Request Body (`application/json`)
{
  "startIndex": 0,
  "destinationIndex": 1,
  "returnQueue": false
}
200: OK
{
  "status": "ok"
}

POST /queue/remove-by-index

Removes an item from the queue by its index

Note that the index is 1-indexed (starts at 1, not 0). Also note that the queue contains some items that are from the history, so the items visible in the Up Next view in Cider may start at a number higher than 1.

Request Body (`application/json`)
{
  "index": 0
}

POST /queue/clear-queue

Clears the queue of all items.

200: OK
{
  "status": "ok"
}

POST /seek

Seeks to a given offset, in seconds, in the currently playing item.

Accepts a position in seconds to seek to. Note that /now-playing returns a timestamp in milliseconds via the durationInMillis key, which should be divided by 1000 to get the duration in seconds.

Request Body (`application/json`)
{
  "position": 30
}
204: No Content

```json // No Response Body... ```

GET /volume

Gets the current playback volume as a number between 0 (muted) and 1 (full volume).

200: OK
{
  "status": "ok",
  "volume": 0.5
}

POST /volume

Sets the current playback volume to a number between 0 (muted) and 1 (full volume).

Accepts a volume as a number between 0 and 1.

Request Body (`application/json`)
{
  "volume": 0.5
}
200: OK
{
  "status": "ok"
}

POST /add-to-library

Adds the currently playing item to the user's library. No effect if already in library.

200: OK
{
  "status": "ok"
}

POST /set-rating

Adds a rating to the currently playing item. Rating is -1 for dislike, 1 for like, and 0 for unset.

Accepts a rating as a number between -1 and 1.

Request Body (`application/json`)
{
  "rating": 1
}
200: OK
{
  "status": "ok"
}

GET /repeat-mode

Gets the current repeat mode as a number. 0 is off, 1 is "repeat this song", and 2 is "repeat".

200: OK
{
  "status": "ok",
  "value": 0
}

POST /toggle-repeat

Toggles repeat between "repeat this song", "repeat", and "off".

Note that this method doesn't take the mode to set, just changes to the next mode in the cycle repeat this song -> repeat -> off.

200: OK
{
  "status": "ok"
}

GET /shuffle-mode

Gets the current shuffle mode as a number. 0 is off and 1 is on.

200: OK
{
  "status": "ok",
  "value": 0
}

POST /toggle-shuffle

Toggles shuffle between "off" and "on".

200: OK
{
  "status": "ok"
}

GET /autoplay

Gets the current autoplay status as a boolean. true is on and false is off.

200: OK
{
  "status": "ok",
  "value": true
}

POST /toggle-autoplay

Toggles autoplay between "off" and "on".

200: OK
{
  "status": "ok"
}

/api/v1/amapi

The API endpoints documented below are all nested under /api/v1/amapi. These API endpoints are generally for more advanced use-cases than the above endpoints, and pass through the raw Apple Music API responses directly with no translation.

POST /run-v3

Makes a request to the given path on the Apple Music API and returns the response.

Request Body (`application/json`)
{
  "path": "/v1/catalog/ca/search?{very long query string}"
}
200: OK
{
  "data": {
	// Direct Apple Music API response
  }
}

/api/v1/lyrics

The API endpoint documented below is nested under /api/v1/lyrics.

GET /:id

Gets lyrics for the given song ID. Currently non-functional but on track to be fixed soon.

200: OK

// Currently omitted until endpoint is fully functional

1.client

docs

Disclaimer

The disclaimer for what support we can provide through GitHub or Discord. Please note this before proceeding to ask for help.

Support (Releases)

Support is fully provided to all releases made on any of our release platforms (Itch, Microsoft Store and Taproom). Please open an issue, and we will try and fix the issue ASAP. Upon issues being fixed, you will need to wait until the next release if you wish to experience the fixed version in a stable state.

Support (Early-Access Releases)

In early access releases the same applies as with normal releases: Support is fully provided and feel free to open an Issue on GitHub if you have problems. However, with these types of releases, you need to remember that they are non-stable releases and you may encounter issues. These builds of the application do not reflect the complete state of the app in any way.

Compiling on Linux

This page allows you to figure out the steps and programs needed to compile your own version of Cider.

Getting Started

Recommended / Required Development Utilities

  • NodeJS 14.0.0 or greater

  • pnpm (Optional, but highly recommended)

  • Git

  • Python 3.8 or greater

  • Basic Command Line Knowledge

::alert{type="warning"} While not required, PNPM is recommended for compiling Cider, and you can install it by using:

npm install -g pnpm ::

Cloning the repository

Open a terminal window in the directory you'd like Git to clone to and enter the following command

git clone https://github.com/ciderapp/Cider.git

Optionally, if you'd like to use the Development branch of Cider to test upcoming features switch your branch by moving your terminal into the directory and using git to checkout the branch by entering the following commands

cd Cider\
git checkout develop

::alert{type="note" title="Success"} If you'd like to update your repository in the future to keep up to date, use the command (Make sure you're in the directory, you originally cloned in)

git pull

Installing Dependencies

Now for the fun part, by using pnpm, npm or yarn (we'll be using pnpm in this case) enter the following command to automatically obtain all required dependencies for installation.

pnpm install
npm install --force
yarn install

::alert{type="note"} This step could take a little while on some machines. ::

Compiling Cider

This step takes a little while on the first compilation so bear with it as it does what it needs to do.

Compiling Cider for specific CPU architectures is a smart thing to do and you can do it by adding switches to the dist argument as displayed.

// For x86_64 machines. (Modern PC's)
pnpm dist -l --x64

// For x86 ONLY machines. (Legacy PC's)
pnpm dist -l --ia32
// For x86_64 machines. (Modern PC's)
npm run dist -l --x64

// For x86 ONLY machines. (Legacy PC's)
npm run dist -l --ia32
// For x86_64 machines. (Modern PC's)
yarn dist -l --x64

// For x86 ONLY machines. (Legacy PC's)
yarn dist -l --ia32

::alert{type="warning"} On some low-end machines this process could take up to ~10 minutes. ::

::alert{type="warning"} This command would build three separate packages of Cider, AppImage, .deb, and .snap packages ::

Compiling Cider from AUR

If you are on an arch-based Linux distribution and have an AUR helper (pacman/yay/paru/etc.), then you are in luck. Cider has 2 PKGBUILD's in the Arch User Repository.

Assuming you already have access to the AUR and have a friendly AUR helper (we will use yay for this example) enter the following command to automatically obtain all required dependencies for installation.

::alert{type="tip"} If you like to live on the bleeding edge, use the cider-git package, this will compile directly from the main branch. :;

yay -S cider

::alert{type="warning"} Running this on Node.js 17 or later will fail. This is due to Node.js 17 no longer writing openssl_fips to config.gypi so it's not there in Node.js 17's process.config. It is suggested to downgrade to nodejs-lts-gallium to resolve this issue. ::

Installing Cider

Your new Cider installation setup file is ready for you! You can find your setup executable in your cloned folder directory on your system in the subfolder dist/ and from there you'll see your new Setup files. Choose the installer that best matches your distro.

::alert{type="note" title="Success"} Congrats! You've successfully compiled your own build of Cider! ::

Client Protocol Schema

A list of various bits of documentation for the app.

The client uses a set list of protocols, including custom and overriding ones for AM apps. This is a list of all the protocols that the client uses.

  • cider

  • itms

  • itmss

  • music

  • itunes

URL Schema

The URL schema is as follows: protocol://{action}/{type}/{id}

The available actions are:

  • play

  • open

The available types are:

  • s (song)

  • a (album)

  • p (playlist)

  • r (radio)

The ID must be the catalog ID of the item as the library item may not be available.

Additional Protocols

The client also handles additional protocols such as:

  • Apple Music URLs: protocol://music.apple.com/...

  • Our Discord Server: protocol://discord

  • Our GitHub: protocol://github

  • OpenCollective: protocol://donate

  • An AppData URL: protocol://appdata (For troubleshooting)

  • Any standard app route. Such as protocol://settings or protocol://am/home

Compiling on Windows

This page allows you to figure out the steps and programs needed to compile your own version of Cider.

Getting Started

Recommended / Required Development Utilities

  • NodeJS 14.0.0 or greater

  • pnpm (Optional, but highly recommended)

  • Git

  • Python 3.8 or greater

  • Basic Command Line Knowledge

  • windows-build-tools

::alert{type="warning"} While not required, PNPM is recommended for compiling Cider, and you can install it by using:

npm install -g pnpm ::

::alert{type="caution"} You need windows-build-tools to be able to compile the native modules Cider uses for Windows. It should be installed with Node.js through the chocolatey package manager. If the installation fails you can install it using pnpm/npm in an administrator powershell/cmd window and entering:

pnpm install -g windows-build-tools

or

npm install -g windows-build-tools ::

Cloning the repository

Open a command prompt window in the directory you'd like Git to clone to and enter the following command

git clone https://github.com/ciderapp/Cider.git

Optionally, if you'd like to use the Development branch of Cider to test upcoming features switch your branch by moving your terminal into the directory and using git to checkout the branch by entering the following commands

cd Cider/
git checkout develop

::alert{type="tip"} If you'd like to update your repository in the future to keep up to date, use the command (Make sure you're in the directory, you originally cloned in)

git pull ::

Installing Dependencies

Now for the fun part, by using pnpm, npm or yarn (we'll be using pnpm in this case) enter the following command to automatically obtain all required dependencies for installation.

pnpm install
npm install --force
yarn install

::alert{type="tip"} This step could take a little while on some machines. ::

Compiling Cider

This step takes a little while on the first compilation so bare with it as it does what it needs to do.

Compiling Cider for specific CPU architectures is a smart thing to do and you can do it by adding switches to the dist argument as displayed.

// For x86_64 machines. (Modern PC's)
pnpm dist -w --x64

// For x86 ONLY machines. (Legacy PC's)
pnpm dist -w --ia32
// For x86_64 machines. (Modern PC's)
npm run dist -w --x64

// For x86 ONLY machines. (Legacy PC's)
npm run dist -w --ia32
// For x86_64 machines. (Modern PC's)
yarn dist -w --x64

// For x86 ONLY machines. (Legacy PC's)
yarn dist -w --ia32

::alert{type="warning"} On some low-end machines this process could take up to ~5 minutes. ::

Installing Cider

Your new Cider installation setup file is ready for you! You can find your setup executable in your cloned folder directory on your system in the subfolder dist/ and from there you'll see your new Setup file.

::alert{type="note" title="Success"} Congrats! You've successfully compiled your own build of Cider! ::

2.other

2.compilation

3.legacy-docs

Compiling on macOS

This page allows you to figure out the steps and programs needed to compile your own version of Cider.

Getting Started

Recommended / Required Development Utilities

  • NodeJS 14.0.0 or greater

  • pnpm (Optional, but highly recommended)

  • Git

  • Python 3.8 or greater

  • Xcode 11+

  • Have an Apple Developer Account and be a member of the Apple Developer Program. This is necessary to play music through the app.

  • Basic Command Line Knowledge

::alert{type="warning"} While not required, PNPM is recommended for compiling Cider, and you can install it by using:

npm install -g pnpm ::

::alert{type="caution"} To remind you again, if you don't have an Apple Developer account to sign the Cider binary after building, it WILL NOT work. ::

Cloning the repository

Open a command prompt window in the directory you'd like Git to clone to and enter the following command

git clone https://github.com/ciderapp/Cider.git

Optionally, if you'd like to use the Development branch of Cider to test upcoming features switch your branch by moving your terminal into the directory and using git to checkout the branch by entering the following commands

cd Cider/
git checkout develop

::alert{type="tip"} If you'd like to update your repository in the future to keep up to date, use the command (Make sure you're in the directory, you originally cloned in)

git pull ::

Installing Dependencies

Now for the fun part, by using pnpm, npm or yarn (we'll be using pnpm in this case) enter the following command to automatically obtain all required dependencies for installation.

pnpm install
npm install --force
yarn install

::alert{type="note"} This step could take a little while on some machines. ::

Create an account to VMP-sign Cider.

What is this for? MacOS doesn't like development Widevine DRM keys for some reason. Therefore, we need to sign our own production keys here. This can be done as follows:

python3 -m pip install --upgrade castlabs-evs
python3 -m castlabs_evs.account signup
Signing up for castLabs EVS
 - A valid e-mail address is required for account verification
>> E-mail Address []: me@example.com
>> First Name []: Me
>> Last Name []: Example
>> Organization []: Example, Inc
>> Account Name []: example
>> Password []: XXXXXXXX
>> Verify Password []: XXXXXXXX
Confirming EVS account
 - A confirmation code has been sent to your e-mail address
>> Confirmation Code []: XXXXXX
Discarding authorization token(s)
Refreshing authorization token(s)

Remember your account name and password because you will need it later.

Once in a while, you may need to re-authenticate the VMP account. If that is the case:

python3 -m castlabs_evs.account reauth
Discarding authorization token(s)
Refreshing authorization token(s)
>> Account Name [example]: 
>> Password []: XXXXXXXX

Create Apple signing keys and app-specific password.

  1. In Xcode: Under Xcode > Preferences (⌘,) > Accounts, you may add your Apple ID. With your team selected, the View Details... in the bottom right could find you the available certificates for generation/download.

  2. After that, select all of the certificates in Keychain Access to generate as a .p12 file. Remember the file location and the .p12 password.

  3. Generate the app-specific password of your Apple Developer account

Setting up environment variables.

export CSC_LINK= <location to the p12 certificate>
export CSC_KEY_PASSWORD= <p12 certificate password>
export APPLEID= <your Apple Developer email address>
export APPLEIDPASS= <your Apple Developer app-specific password>

You can set the environment variables permanently by edit the ~/.bash-profile file and add the above lines at the bottom of the file.

~/.bash-profile

Final fixes

Electron-Packager doesn't like MacOS notarization. You need to manually patch the files in order for it to work properly:

cp resources/verror-types node_modules/@types/verror/index.d.ts
cp resources/macPackager.js node_modules/app-builder-lib/out/macPackager.js 

Compiling Cider

This step takes a little while on the first compilation so bear with it as it does what it needs to do.

This will generate a universal signed and notarized binary. (Don't mind the "not working" command line, it works)

pnpm dist:universalNotWorking -p never
npm run dist:universalNotWorking -p never
yarn dist:universalNotWorking -p never

::alert{type="warning"} On some low-end machines this process could take up to ~20-30 minutes. (It will look like it hangs at the notarization part, don't exit it). ::

Installing Cider

Your new Cider installation setup file is ready for you! You can find your setup executable in your cloned folder directory on your system in the subfolder dist/ and from there you'll see your new Setup file.

::alert{type="note" title="Success"} Congrats! You've successfully compiled your own build of Cider! ::

Frontend API

This page contains documentation on the functions included in the CiderFrontAPI.

Renderer Helpers
  • CiderFrontAPI.*

  • AddMenuEntry(entry: CiderFrontAPI.Objects.MenuEntry) - Add an entry to the Cider menu

  • StyleSheets

    • Add(href: string) - Load a .less stylesheet from a URL

Registering a Vue component as a page

Registering a Vue component is done by adding plugin. to the front of the component name. Pages can then be loaded with app.appRoute("plugin/<component name without plugin.>")

Accessing static resources from the renderer

Additional resources in the plugins such as images and other files can be accessed with methods like fetch() from ./plugins/:packageName/:file this resolves to http://localhost:{port}/plugins/:packageName/:file

:packageName refers to the name property in package.json for the plugin.

Importing Custom Stylesheets

Example:

CiderFrontAPI.StyleSheets.Add("./plugins/:packageName/mystylesheet.less")

:packageName refers to the name property in package.json for the plugin.

CiderAudio

Note: CiderAudio requires Advanced Audio Functionality to be enabled in the app settings.

Cider features a custom audio stack, available in the renderer.

  • CiderAudio.context - Primary AudioContext

  • CiderAudio.source - Audio Source

CiderAudio contains the following nodes:

  • CiderAudio.audioNodes.gainNode - Main gain node

  • CiderAudio.audioNodes.spatialNode - Used by audio spatialization

  • CiderAudio.audioNodes.audioBands - Used by EQ

  • CiderAudio.audioNodes.vibrantbassNode - Used to deliver vibrant bass functionality

  • CiderAudio.audioNodes.llpw - Used by Cider Adrenaline Processor (CAP)

  • CiderAudio.audioNodes.analogWarmth - Used by Analog Warmth

audio.js explained

https://github.com/ciderapp/Cider/blob/develop/src/renderer/audio/audio.js

CiderAudio initializes with CiderAudio.hierarchical_loading() Inside the loading process, all audioNodes are cleared and re-initialized and chained based on what the user has enabled. The designed hierarchy for loading audio functions is as follows:

  • h1 item - AudioBand (final output)

  • h2 item 1 - AudioBands vibrantbass_h2_1() (vibrant bass node)

  • h2 item 2 - llpw_h2_2() (CiderAudio.audioNodes.llpw)

  • h2 item 3 - analogWarmth_h2_3() (CiderAudio.audioNodes.analogWarmth)

  • Spatial Node is always the last node in the chain

Creating a Basic Plugin

README

Cider Documentation

This repository contains the documentation of the Cider app. This serves as the central hub for all documentation related to the Cider Client, providing comprehensive guides, best practices, and reference materials for end-users and developers alike.

If you are interested in contributing to this project, please read the Contributing Guidelines.

Troubleshooting FAQs

The main Frequently Asked Questions for Cider application support.

::alert{type="note"} This is essential knowledge for the debugging process, please read these before creating an issue. ::

How to find the Application Data Directory

The location of your application data varies depending on your operating system, see your platforms path below:

  • MS Store: %localappdata%\packages\27554FireDevElijahKlauman.CiderEA_270bejk4xgzqp\LocalCache\Roaming\C2Windows

  • Windows (non-MS Store): %appdata%\C2Windows

  • Linux: $HOME/.config/sh.cider.genten

  • MacOS: /Library/Application Support/sh.cider.genten

Why is my DiscordRPC status not appearing?

Try the following if Discord Rich Presence is not appearing on Discord.

Discord Desktop Client Only

Ensure you only have the Discord desktop client, not the web client open. As Cider is not directly connected to Discord we cannot have your status showing when not connected to Cider directly through Discord's Rich Presence functionality.

Activity Status Message

Make sure that 'Display current activity as a status message' is enabled in your Activity Status category in the Discord settings. Cider will not appear as a game, so do not manually add it.

Snapcraft Store Issues

If you are using Discord from the Snap Store, you are advised to install from a different source (Discords Website or using another package manager). The Snap Store version of Discord is known to have issues with DiscordRPC.

Permissions and Elevation

Ensure that you are running Discord on a level that is below Cider. If Discord is being elevated, Cider will be unable to connect. Furthermore, ensure that Discord is started first. Cider has to connect to Discord and this is only done on Cider's launch. So make sure Discord is started before Cider.

Cider is Skipping or Not Playing Explicit Songs

If you are experiencing this issue, your account might have content restrictions set to "Clean". Login to Apple Music Web, go to Profile Picture > Settings, then login again and check the "Content Restrictions" under "Parent Controls".

Make sure that Music is set to Explicit.

::alert{type="note"} It could potentially be a case where explicit playback is restricted in your country, in this case you may need to change your Apple Account region to resolve this. ::

Why do I keep getting 'localtunnel.me connection refused' on macOS?

This is a fairly rare case and can be resolved fairly easily. Follow the steps below and it should resolve your issue:

  1. Disable any Antivirus and/or Firewall present on your device. These can conflict with the WebSocket API in the client and will cause this error. (ESET is a known offender for this.)

  2. Ensure you do not have a VPN on or any policies enabled on your device that can affect network traffic. Company managed devices may also have policies blocking this.

  3. Check that you do not have Cider running already - and that nothing is running on the same port that Cider operates under - 10767.

Outside of this advice, there is an open issue on localtunnel for it, unfortunately we are stuck with it as one of the key components in Cider uses it as a dependency. We cannot help further on this issue.

Why is the app launching with a blank screen on Linux?

This is a somewhat common issue for those on OpenSuse and other distro's that require their /etc/hosts file to manually set. To resolve this issue, you will need to ensure that your /etc/hosts file is set up correctly. See the example below for how it should look:

127.0.0.1 localhost
::1 localhost
127.0.0.2 YOUR_HOSTNAME

Additional Links

Some resources to aid you in your plugin development.

REST API

Learn how to control the client using REST

Cider offers a simple REST API to remotely control the app.

URL: http://localhost:9000/api/

Endpoints

Endpoint
Description
Endpoint
Method
Description
Usage

documentation

Backend Development

PluginEnv

When plugins are loaded in Cider the constructor() in the plugin class is passed a PluginEnv object, this object contains:

  • app - The Electron app

  • store - Electron Store

  • utils - Cider utils

  • win - The renderer window

  • dir - Path to the plugin directory

  • dirName - Plugin directory name

Load a front end plugin

To load a front end plugin (typically named index.frontend.js) from index.js PluginEnv.utils.loadJSFrontend(path: string) is used.

Example: PluginEnv.utils.loadJSFrontend(path.join(PluginEnv.dir, "index.frontend.js"))

utils
  • getPath(path: string) - Returns path used by Cider by name.

    • srcPath - src/ folder

    • rendererPath - renderer/ folder

    • mainPath - main/ path

    • resourcePath - resources/ path

    • i18nPath - i18n/ path

    • ciderCache - Cider cache path

    • themes - Themes

    • plugins - Plugins

  • getLocale(language: string, key: string)

    • Fetches the i18n locale for the given language.

  • getStoreValue(key: string)

    • Gets a store value

  • getStore()

    • Returns store

  • setStoreValue(key: string, value: any)

    • Sets a store value

  • getWindow()

    • Gets the renderer window

  • loadJSFrontend(path: string)

    • Loads a JavaScript file into the renderer, this is the main method of loading front end plugins.

  • playback. - Controls playback

    • .play() - Play

    • .pause() - Pause

    • .playPause() - Toggles playback

    • .next() - Next track in queue

    • .previous() - Previous track in queue

Built in events

Cider plugins support these methods by default, however more can be made with the use of ipcMain and ipcRenderer

  • onReady(win) - (Required) Executes when the back end is ready

  • onRendererReady() - Executes when the renderer has finished loading (app.init())

  • onPlaybackStateDidChange(attributes) - Executes when playback state changes, passes song attributes

  • onNowPlayingItemDidChange(attributes) - Executes when song changes, passes song attributes

  • onBeforeQuit - Executes before Cider quits

Frontend Development

Renderer Helpers
  • CiderFrontAPI.*

  • AddMenuEntry(entry: CiderFrontAPI.Objects.MenuEntry) - Add an entry to the Cider menu

  • StyleSheets

    • Add(href: string) - Load a .less stylesheet from a URL

Registering a Vue component as a page

Registering a Vue component is done by adding plugin. to the front of the component name. Pages can then be loaded with app.appRoute("plugin/<component name without plugin.>")

Accessing static resources from the renderer

Additional resources in the plugins such as images and other files can be accessed with methods like fetch() from ./plugins/:packageName/:file this resolves to http://localhost:{port}/plugins/:packageName/:file

:packageName refers to the name property in package.json for the plugin.

Importing Custom Styhesheets

Example:

CiderFrontAPI.StyleSheets.Add("./plugins/:packageName/mystylesheet.less")

:packageName refers to the name property in package.json for the plugin.

CiderAudio

Note: CiderAudio requires Advanced Audio Functionality to be enabled in the app settings.

Cider features a custom audio stack, available in the renderer.

  • CiderAudio.context - Primary AudioContext

  • CiderAudio.source - Audio Source

CiderAudio contains the following nodes:

  • CiderAudio.audioNodes.gainNode - Main gain node

  • CiderAudio.audioNodes.spatialNode - Used by audio spatialization

  • CiderAudio.audioNodes.audioBands - Used by EQ

  • CiderAudio.audioNodes.vibrantbassNode - Used to deliver vibrant bass functionality

  • CiderAudio.audioNodes.llpw - Used by Cider Adrenaline Processor (CAP)

  • CiderAudio.audioNodes.analogWarmth - Used by Analog Warmth

audio.js explained

https://github.com/ciderapp/Cider/blob/develop/src/renderer/audio/audio.js

CiderAudio initializes with CiderAudio.hierarchical_loading() Inside the loading process, all audioNodes are cleared and re-initialized and chained based on what the user has enabled. The designed hierarchy for loading audio functions is as follows:

  • h1 item - AudioBand (final output)

  • h2 item 1 - AudioBands vibrantbass_h2_1() (vibrant bass node)

  • h2 item 2 - llpw_h2_2() (CiderAudio.audioNodes.llpw)

  • h2 item 3 - analogWarmth_h2_3() (CiderAudio.audioNodes.analogWarmth)

  • Spatial Node is always the last node in the chain

Publishing to GitHub

Once you have completed your plugin its time to publish! Create a new repository for the plugin and upload the files.

To have the theme indexed into Cider's built in plugin explorer, add cidermusicplugin as a topic on the repository.

Plugins from GitHub in Cider will display the repos README.md file within the Explore Plugins on GitHub page, so be sure to include some screenshots showing off your plugins.

Resources

Renderer

This page contains all the required documentation for the Renderer and its functions/events.

PluginEnv

When plugins are loaded in Cider the constructor() in the plugin class is passed a PluginEnv object, this object contains:

  • app - The Electron app

  • store - Electron Store

  • utils - Cider utils

  • win - The renderer window

  • dir - Path to the plugin directory

  • dirName - Plugin directory name

Loading frontend plugin(s)

To load a front end plugin (typically named index.frontend.js) from index.js PluginEnv.utils.loadJSFrontend(path: string) is used.

Example: PluginEnv.utils.loadJSFrontend(path.join(PluginEnv.dir, "index.frontend.js"))

utils
  • getPath(path: string) - Returns path used by Cider by name.

    • srcPath - src/ folder

    • rendererPath - renderer/ folder

    • mainPath - main/ path

    • resourcePath - resources/ path

    • i18nPath - i18n/ path

    • ciderCache - Cider cache path

    • themes - Themes

    • plugins - Plugins

  • getLocale(language: string, key: string)

    • Fetches the i18n locale for the given language.

  • getStoreValue(key: string)

    • Gets a store value

  • getStore()

    • Returns store

  • setStoreValue(key: string, value: any)

    • Sets a store value

  • getWindow()

    • Gets the renderer window

  • loadJSFrontend(path: string)

    • Loads a JavaScript file into the renderer, this is the main method of loading front end plugins.

  • playback. - Controls playback

    • .play() - Play

    • .pause() - Pause

    • .playPause() - Toggles playback

    • .next() - Next track in queue

    • .previous() - Previous track in queue

Built in events

Cider plugins support these methods by default, however more can be made with the use of ipcMain and ipcRenderer

  • onReady(win) - (Required) Executes when the back end is ready

  • onRendererReady() - Executes when the renderer has finished loading (app.init())

  • onPlaybackStateDidChange(attributes) - Executes when playback state changes, passes song attributes

  • onNowPlayingItemDidChange(attributes) - Executes when song changes, passes song attributes

  • onBeforeQuit - Executes before Cider quits

Cider Frontend API (CiderFrontAPI)

Function/Method
Usage
Details

App Functions/Methods (app.*)

Function/Method
Usage
Details

Cider Audio (CiderAudio)

Function/Method
Usage
Details

/playpause

Toggle between play and pause

/play

Play

/pause

Pause

/stop

Stop the current song

/next

Skip to the next song in the queue

/previous

Go back to the previous song in the queue

/v3

POST

Access the MusicKit instance and use the v3 API routes https://developer.apple.com/documentation/applemusicapi/

Takes 3 parameters. route body options

StyleSheets.Add

AddMenuEntry

Objects.MenuEntry

Example Plugin
Electron App Documentation
Electron BrowserWindow Documentation
Communicating with the Renderer instance from Main (IPC Main)
Communicating with main instance from the Renderer (IPC Renderer)
Example Plugin
General Electron Documentation
BrowserWindow
IPC Main
IPC Renderer

Available Attributes

Attributes are applied to elements to expose app state information to CSS

Attribute Pattern
Values
Description

body[video-playing]

Is a music video playing?

body[focus-state]

  • focused

  • blurred

Focus state of the window

body[playback-state]

  • playing

  • paused

Current playback state

#app[window-style]

  • default - Cupertino

  • twopanel - Redmond

Window Layout Style

Creating a Theme

If one does not already exist, create a new theme directory in the user data folder.

  • Windows: %appdata%/Cider/themes

  • Mac: ~/Library/Application Support/Cider/themes

  • Linux: ~/.config/Cider/themes

Create a new folder in the themes directory with the name of your theme.

  • This folder needs to contain the following files:

    • index.less - The main theme file

    • theme.json - Contains several properties for your theme

  • You can clone a starter template from here: Theme Starter Template

In Cider, select the theme in the settings.

Cider has automatic hot reloading for themes in the userdata folder.

Useful Resources

  • The default styles.less can be found in: src/renderer/style.less

  • Less.js documentation

3.legacy-plugins

Unsorted Features

Unsorted Quirks and Features.

These are some unsorted quirks and features about Cider that will be moved later

  • Cider is built with the following frameworks and technologies

    • Electron

    • Vue 2

    • Express

    • EJS

    • MusicKit.js

    • Some components from Bootstrap 5 (mainly grids and modals)

    • Bootstrap Vue

    • Bootbox

    • Notyf

Theme Definitions (theme.json)

theme.json files require the following properties:

  • name: string - The name of the theme

  • description: string - Brief description of the theme

  • version: string - Version of the theme

  • author: string - Theme authors

  • github_repo: string - The source repository of the theme, this is required for Cider to automatically update the theme. Formatted <owner>/<repo_name>

  • pack: array - (optional) Declare individual LESS files as styles within the package

    • Pack Object Format:

      • name: string - Name of the style

      • file: string - File name within the package / repo

      • description: string - Description of the style

Using Resources in Themes

(Images, Fonts, etc.)

Resources in the theme can be accessed by their filenames in the theme folder.

Examples:

background: url("my_image.png")

@import url('another_less_file.less')

4.themes

Publishing to GitHub

Once you have completed your plugin its time to publish! Create a new repository for the plugin and upload the files.

To have the theme indexed into Cider's built in plugin explorer, add cidermusicplugin as a topic on the repository.

Plugins from GitHub in Cider will display the repos README.md file within the Explore Plugins on GitHub page, so be sure to include some screenshots showing off your plugins.

Publishing to GitHub

Once you have completed your plugin its time to publish! Create a new repository for the theme and upload the files.

To have the theme indexed into Cider's built in theme explorer, add cidermusictheme as a topic on the repository.

Themes from GitHub in Cider will display the repos README.md file within the Explore Themes on GitHub page, so be sure to include some screenshots showing off your theme.