Connection & Authentication
The mobile app connects directly to your self-hosted Snippbot daemon over HTTP(S). There is no Snippbot account to create, and nothing is routed through Snippbot servers. This page covers pairing, connection, and authentication.
First-time setup
Section titled “First-time setup”When you launch the app for the first time, you land on the pairing screen.
-
Get a pairing code
In your daemon’s web UI, open Devices → Pair Device to get a 6-digit pairing code.
-
Enter your daemon address and the code
Type the address of your running Snippbot daemon and the 6-digit code, then tap Connect. Examples:
- Local network:
192.168.1.50, port18781 - Remote Access tunnel or reverse proxy:
https://snippbot.yourdomain.com
On the same network, the app scans for a daemon and pre-fills the address if it finds one.
- Local network:
-
Done — the device is paired
The daemon issues this phone its own device token. There is no username or password.
-
Optional: Turn on push notifications
Push is opt-in. Open Settings → Notifications and tap Request Permission to get alerts for session-join approvals and agent replies. See Push Notifications.
-
Optional: Turn on biometric lock
In Settings → Security, enable the Face ID / fingerprint toggle to lock the app behind your device’s biometrics.
No daemon yet? Tap Explore the demo on the pairing screen to look around with sample data — nothing leaves the device in demo mode.
Local network vs. remote
Section titled “Local network vs. remote”The app stores two addresses for your daemon and picks between them automatically:
| Endpoint | When it’s used |
|---|---|
Local (e.g. 192.168.1.50:18781) | Whenever your phone can reach your daemon’s network. Faster, and traffic never leaves your home |
| Remote (your tunnel address) | When the local address doesn’t answer — cellular, a coffee shop, anywhere else |
Both are stored when you pair by QR. There is nothing to switch when you leave the house; the app probes the local address first, and falls back after about a second and a half.
If you paired before this existed, your single stored address is reclassified automatically on upgrade — you do not need to pair again. To gain the second endpoint, turn on Remote Access and re-pair by QR.
Connection settings
Section titled “Connection settings”After setup, manage your connection in Settings > Connection.
| Setting | Description |
|---|---|
| Connection details | Host, port, TLS status, and base URL of your daemon |
| Health check | Check that the daemon is reachable and responding |
| Endpoints | Your local and remote addresses, with Re-learn from daemon to refresh them |
| Manual override | Set host, port, and TLS by hand |
| Cloudflare Access | Optional service token (client ID and secret) if your tunnel sits behind Cloudflare Access |
| Re-pair Device | Go back to the pairing screen |
How authentication works
Section titled “How authentication works”The mobile app uses bearer token authentication with a per-device token:
- When you pair, the daemon exchanges the 6-digit code (or QR token) for a device token, a refresh token, and a device ID
- The tokens are stored in
expo-secure-store(hardware-backed keystore) - Every API request includes the token in the
Authorization: Bearer <token>header - If the daemon rejects an expired token, the app refreshes it automatically with the refresh token
Push token registration
Section titled “Push token registration”Pairing does not register a push token. Only when you opt in to notifications (Settings → Notifications) does the app send its push token to the daemon:
POST /devices/{device_id}/push-token{ "push_token": "ExponentPushToken[...]", "push_provider": "fcm", "app_version": "1.0.1", "os_version": "android 35", "device_model": "Pixel 8"}This lets the daemon route push notifications to your specific device.
Device fingerprint
Section titled “Device fingerprint”The app generates a hardware fingerprint using a SHA-256 hash of stable device attributes:
- Device model and manufacturer
- OS name and version
- Screen dimensions
This fingerprint is sent with session join requests and verified against the daemon’s trust store. You can require fingerprint matching in session security settings.
Secure storage
Section titled “Secure storage”All sensitive data is stored using expo-secure-store, which maps to:
| Platform | Backend |
|---|---|
| Android | Android Keystore + EncryptedSharedPreferences |
| iOS (planned) | Keychain Services (hardware-encrypted) |
Stored items:
- Device token and refresh token
- Device ID
- Connection details
- Device fingerprint
Changing your daemon
Section titled “Changing your daemon”To connect to a different Snippbot instance:
- Open the Settings tab
- Tap Disconnect at the bottom and confirm
- On the pairing screen, enter the new daemon address
- Enter a pairing code from the new daemon’s Devices → Pair Device
Troubleshooting
Section titled “Troubleshooting””Connection failed” on setup
Section titled “”Connection failed” on setup”- Verify the daemon is running:
snippbot statuson your server - Check the port (default:
18781) - Ensure your phone and server are on the same network, or turn on Remote Access
- Pairing codes are single-use — generate a new one if the old one may have been used
Token expired
Section titled “Token expired”The app refreshes tokens automatically. If you still see an auth error:
- Go to Settings > Connection
- Tap Re-pair Device
- Enter a fresh pairing code from the web UI
Device not showing in daemon
Section titled “Device not showing in daemon”- On the daemon web UI, go to Devices and check whether the phone appears
- If it’s missing, re-pair from Settings > Connection > Re-pair Device