OAuth2 (Recommended)
Authenticate using the device flow — no client ID or secret needed:- Display a one-time code in your terminal
- Open your browser to authorize
- Automatically save credentials to
~/.socialsyncs/credentials.json
Auth Commands
API Key
Alternatively, set your SocialSyncs API key as an environment variable:OAuth2 credentials take priority over the API key when both are present.
Environment Variables
*Either OAuth2 (via
socialsyncs auth:login) or SOCIALSYNCS_API_KEY is required.
Self-Hosting the Auth Server
By default,socialsyncs auth:login uses the hosted auth server at cli-auth.socialsyncs.co. If you want to self-host the OAuth2 device flow server, you can run your own instance.
The auth server mediates the OAuth2 device flow so CLI users can authenticate without needing client credentials.
Prerequisites
- Node.js >= 18
- PostgreSQL
How It Works
1. Clone the Repository
The auth server lives in the socialsyncs-cli repository:2. Create an OAuth App in SocialSyncs
Go to SocialSyncs Settings > Developer > OAuth Apps and create a new app. Set the callback URL to:3. Set Up Postgres
Create a database. The server auto-creates thedevice_requests table on startup.