> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rocksky.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Mirror from ListenBrainz

> Pull listens from a ListenBrainz account into Rocksky on a 30-second poll.

Rocksky polls ListenBrainz's `/1/user/{name}/listens` endpoint every 30
seconds and mirrors new listens into your Rocksky timeline.

## Prerequisites

* A [Rocksky](https://rocksky.app) account
* A ListenBrainz account that's actively receiving listens
* A ListenBrainz user token

## Setup

<Steps>
  <Step title="Get your user token">
    While signed in to ListenBrainz, open
    [listenbrainz.org/settings](https://listenbrainz.org/settings/) and copy
    your **user token**.
  </Step>

  <Step title="Open the Mirrors page">
    Sign in to Rocksky and open
    [rocksky.app/mirrors](https://rocksky.app/mirrors). Select the
    **ListenBrainz** tab.
  </Step>

  <Step title="Enter your credentials">
    * **Username** — your ListenBrainz handle.
    * **ListenBrainz user token** — the token from step 1.

    Click **Save credentials**. The token is encrypted with
    XSalsa20-Poly1305 before being written to the database.
  </Step>

  <Step title="Enable mirroring">
    Flip the **Mirror enabled** toggle on. The worker picks up the new source
    within \~30 seconds and starts polling.
  </Step>
</Steps>

## What gets mirrored

* Listens returned from `/1/user/{name}/listens`, scoped server-side with
  `min_ts` so each poll only pulls what's new since the last watermark.
* On first enable, a 24-hour backfill window is seeded.

## Dedup behaviour

Each listen is checked against your existing scrobbles within a ±120-second
window. If you already scrobble to Rocksky from a client that also writes to
ListenBrainz, you won't get duplicates.

## Rotating or removing the token

* **Rotate** — paste a new token and save.
* **Remove** — clear the token and save; the worker exits.

<Note>
  ListenBrainz's listens endpoint is publicly readable for non-private
  accounts, but Rocksky still requires a token so polling stays under the
  authenticated rate limit and mirrors keep up.
</Note>
