Setup required
Fieldwatch Command signs in with official X OAuth 2.0 (Authorization Code + PKCE) and calls api.x.com as you. Set these server env vars — never VITE_ prefixes, never in frontend JS.
X_CLIENT_IDmissingOAuth 2.0 Client ID from the X Developer App
X_CLIENT_SECRETmissingOAuth 2.0 Client Secret — confidential client, server-only
X_REDIRECT_URImissingOptional override. Leave unset to derive from the current origin so preview and publish both work.
Callback URL to paste into the X Developer App
https://01a01c93-cf25-7791-b844-12d1bc78d5e6-2kirga2ms-xai-org.vercel.app/api/x/callback
App type: Web App (confidential). After publish, also register https://YOUR-APP.grok.me/api/x/callback. Leave X_REDIRECT_URI unset to derive the callback per origin.
Scopes: tweet.read tweet.write users.read offline.access like.read like.write follows.read follows.write media.write