Skip to content

Getting Started

github-actions[bot] edited this page Jul 5, 2026 · 7 revisions

Getting Started

This page walks you from a fresh clone to a running miner in under 5 minutes.

Prerequisites

1. Clone and configure

git clone https://github.com/Guliveer/twitch-miner-go.git
cd twitch-miner-go

# Create a config file for your account (filename = Twitch username)
cp configs/example.yaml.example configs/your_twitch_username.yaml

Note: The repository includes the maintainer's own account configs. They are skipped automatically — you do not need to delete or disable them. Set RUN_OWNER_ACCOUNTS=true only if you are the maintainer running on your own infrastructure.

Open the file and set at least:

enabled: true

streamers:
  - username: "some_streamer"

See Configuration Reference for all options.

2. Set required environment variables

Create a .env file (copy .env.example as a starting point):

TWITCH_CLIENT_ID_TV=your_tv_client_id
TWITCH_CLIENT_ID_BROWSER=your_browser_client_id
TWITCH_CLIENT_VERSION=your_client_version

See How to obtain Twitch runtime identifiers in the README for step-by-step instructions.

3. Run

Linux / macOS:

./_run.sh

Windows:

_run.bat

Both scripts build the binary and run it immediately.

4. Authenticate

On first run the miner walks through the authentication chain. The easiest path is the device code flow — the miner will print:

To activate, visit https://www.twitch.tv/activate and enter code: ABCD-1234

Visit the URL, enter the code, and the miner saves a cookie for future runs — no re-auth needed.

5. Verify it's working

# Health check
curl http://localhost:8080/health

# Test notifications (if configured)
curl -X POST http://localhost:8080/api/test-notification

The analytics dashboard is available at http://localhost:8080.

Telemetry

By default the miner sends anonymous usage heartbeats — instance ID, version, OS, architecture, deployment label, running accounts count, and total configs count. No personal data, channel names, or IP addresses are transmitted. Set TELEMETRY_AGREE=false in your environment to disable.

The server-side dashboard is open source: twitch-miner-go-telemetry.

Automatic updates

Pass -auto-update to have the miner update itself on startup:

./_run.sh -auto-update

When a new release is found, the miner downloads the new binary, replaces itself, and exits — the service manager restarts it with the new version. If anything goes wrong, it falls back to printing the usual update notice.

For a systemd service, add the flag to ExecStart:

ExecStart=/usr/local/bin/twitch-miner-go -config /etc/twitch-miner-go/configs -auto-update

For a Windows NSSM service, add -auto-update to the service arguments (re-run _install-service.bat or edit via NSSM GUI).

Not useful for Docker or Fly.io — those update by pulling a new image.

Next steps

Clone this wiki locally