2026-05-12 22:01:25 -04:00
|
|
|
# Quick Start: Authenticated Kosmi Access
|
2025-11-01 21:00:16 -04:00
|
|
|
|
|
|
|
|
## Step 1: Create Bot Account
|
|
|
|
|
|
|
|
|
|
1. Go to https://app.kosmi.io
|
|
|
|
|
2. Sign up with a dedicated email (e.g., `your-bot@example.com`)
|
|
|
|
|
3. Choose a display name (e.g., "HSO Relay Bot")
|
|
|
|
|
4. Save the credentials securely
|
|
|
|
|
|
2026-05-12 22:01:25 -04:00
|
|
|
## Step 2: Configure Matterbridge
|
2025-11-01 21:00:16 -04:00
|
|
|
|
|
|
|
|
Edit `matterbridge.toml`:
|
|
|
|
|
|
|
|
|
|
```toml
|
|
|
|
|
[kosmi.hyperspaceout]
|
2026-05-12 22:01:25 -04:00
|
|
|
RoomURL="https://app.kosmi.io/room/@yourroom"
|
2025-11-01 21:00:16 -04:00
|
|
|
Email="your-bot@example.com"
|
|
|
|
|
Password="your-secure-password"
|
|
|
|
|
```
|
|
|
|
|
|
2026-05-12 22:01:25 -04:00
|
|
|
## Step 3: Run and Verify
|
2025-11-01 21:00:16 -04:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
./matterbridge -conf matterbridge.toml
|
|
|
|
|
```
|
|
|
|
|
|
2026-05-12 22:01:25 -04:00
|
|
|
Watch the logs for:
|
|
|
|
|
- `"Authenticating with email/password..."` -- browser login starting
|
|
|
|
|
- `"✅ Authentication successful"` -- login completed
|
|
|
|
|
- `"💾 Token cached"` -- token saved for reuse
|
|
|
|
|
- `"Successfully connected to Kosmi"` -- connected to room
|
|
|
|
|
|
|
|
|
|
On subsequent runs with a cached token:
|
|
|
|
|
- `"✅ Using cached token"` -- no browser needed
|
|
|
|
|
|
|
|
|
|
## Step 4: Test
|
|
|
|
|
|
|
|
|
|
1. Send a message in the Kosmi room from a browser
|
|
|
|
|
2. Verify it appears in your IRC channel
|
|
|
|
|
3. Send a message from IRC
|
|
|
|
|
4. Verify it appears in Kosmi with the bot's display name
|
|
|
|
|
|
2025-11-01 21:00:16 -04:00
|
|
|
## Verification Checklist
|
|
|
|
|
|
2026-05-12 22:01:25 -04:00
|
|
|
- [ ] Bot account created at app.kosmi.io
|
|
|
|
|
- [ ] Credentials added to `matterbridge.toml`
|
2025-11-01 21:00:16 -04:00
|
|
|
- [ ] Bridge logs show authenticated connection
|
|
|
|
|
- [ ] Bot display name appears correctly in chat
|
2026-05-12 22:01:25 -04:00
|
|
|
- [ ] Messages relay bidirectionally
|
|
|
|
|
- [ ] Token cache file exists (`data/kosmi_token_cache.json` or `~/.matterbridge/kosmi_token_cache.json`)
|
2025-11-01 21:00:16 -04:00
|
|
|
|
|
|
|
|
## Troubleshooting
|
|
|
|
|
|
|
|
|
|
### Anonymous connection despite credentials
|
|
|
|
|
|
2026-05-12 22:01:25 -04:00
|
|
|
Check that both `Email` and `Password` are set and non-empty:
|
2025-11-01 21:00:16 -04:00
|
|
|
```bash
|
2026-05-12 22:01:25 -04:00
|
|
|
grep -E "Email|Password" matterbridge.toml
|
2025-11-01 21:00:16 -04:00
|
|
|
```
|
|
|
|
|
|
2026-05-12 22:01:25 -04:00
|
|
|
### Authentication fails
|
|
|
|
|
|
|
|
|
|
- Verify Chrome/Chromium is installed
|
|
|
|
|
- Test credentials by logging in manually at app.kosmi.io
|
|
|
|
|
- Delete cached token to force fresh auth: `rm data/kosmi_token_cache.json`
|
|
|
|
|
- Enable debug logging: `-debug`
|
|
|
|
|
|
2025-11-01 21:00:16 -04:00
|
|
|
### Token expired
|
|
|
|
|
|
2026-05-12 22:01:25 -04:00
|
|
|
The bridge automatically refreshes tokens expiring within 7 days. If refresh fails:
|
|
|
|
|
- Check logs for authentication errors
|
2025-11-01 21:00:16 -04:00
|
|
|
- Verify credentials are still valid
|
2026-05-12 22:01:25 -04:00
|
|
|
- Delete the token cache and restart
|
2025-11-01 21:00:16 -04:00
|
|
|
|
|
|
|
|
## Next Steps
|
|
|
|
|
|
2026-05-12 22:01:25 -04:00
|
|
|
- See [BROWSER_AUTH_GUIDE.md](BROWSER_AUTH_GUIDE.md) for full authentication details
|
|
|
|
|
- See [TOKEN_PERSISTENCE.md](TOKEN_PERSISTENCE.md) for token caching behavior
|