xbook needs X (Twitter) API credentials to sync your bookmarks. This guide walks you through getting them.
- Go to the X Developer Portal
- Sign in with your X account
- Apply for a developer account if you don't have one
- Select "Hobbyist" or "Student" use case
- Describe your use: "Personal bookmark organizer for managing and searching my saved posts"
- Accept the Developer Agreement
- In the Developer Portal, go to Projects & Apps
- Click + Add Project
- Name:
xbook(or anything you like) - Use case: Personal
- Description: "Bookmark organizer"
- Name:
- Click + Add App within the project
- Name:
xbook-app - Environment: Production
- Name:
- Go to your app's Settings tab
- Under User authentication settings, click Set up
- Configure:
- App permissions: Read (minimum — xbook only reads bookmarks)
- Type of App: Web App, Automated App or Bot
- Callback URI / Redirect URL:
- CLI:
http://127.0.0.1:8917/callback - Web:
http://localhost:3000/api/connect-x/callback
- CLI:
- Website URL: Your domain or
https://github.com/joedanz/xbook
- Click Save
- Go to your app's Keys and Tokens tab
- Under OAuth 2.0 Client ID and Client Secret:
- Copy the Client ID
- Click Regenerate to get the Client Secret (shown once)
- Save these securely
Add to your .env.local file in the project root:
X_CLIENT_ID=your_client_id_here
X_CLIENT_SECRET=your_client_secret_hereThen run:
xbook loginAdd to .env.local in the project root:
X_CLIENT_ID=your_client_id_here
X_CLIENT_SECRET=your_client_secret_herePass as environment variables:
docker run -e X_CLIENT_ID=... -e X_CLIENT_SECRET=... ghcr.io/joedanz/xbookOr in docker-compose.yml:
environment:
- X_CLIENT_ID=your_client_id_here
- X_CLIENT_SECRET=your_client_secret_here| Problem | Solution |
|---|---|
| "Invalid redirect_uri" during login | Make sure the callback URL in the X Developer Portal matches exactly (including port and path) |
| "Forbidden" when syncing bookmarks | Ensure your app has at least Read permissions in User Authentication Settings |
| "Rate limit exceeded" from X API | X API has its own rate limits (300 requests / 15 minutes for bookmarks). Wait and try again. |
OAuth callback uses localhost |
X rejects localhost — use 127.0.0.1 instead, or set OAUTH_REDIRECT_URI explicitly |
xbook respects X's API rate limits. The bookmark lookup endpoint allows:
- 300 requests per 15-minute window per user token
- Each request fetches up to 100 bookmarks
For most users, a single sync fetches all bookmarks within these limits.