- Look up users by username or ID
- Search recent public posts
- Read public post metadata by ID
- Build dashboards and integrations on top of X API v2 data
Common use cases and example apps
How to connect X
Workspace admins and owners can connect X. You can create multiple X connections using different Bearer tokens, which is useful for separating environments (for example, development and production) or using tokens from different X apps. When the connection is created, X becomes available across all projects in the workspace. Anyone building in a project can ask Lovable in chat to link their project to it.Prerequisites
Before connecting X, make sure you have:- An X Developer account
- An X app with an app-only Bearer token
- Lovable workspace owner or admin role
All API requests made through this connector count toward your X API access tier and rate limits. Billing and quota are handled directly by X, not Lovable.
Step 1: Get an X app-only Bearer token
An app-only Bearer token lets your Lovable app authenticate with the X API v2 for read-only public data. You generate it in the X Developer Portal for a specific app. To create an X Bearer token:1
Open the X Developer Portal
Sign in to the X Developer Portal.
2
Create or open a project and app
Create a Project and App if you do not have one yet, or open the app you want to use.
3
Open keys and tokens
In your app settings, go to Keys and tokens (or User authentication settings → Keys and tokens, depending on your portal layout).
4
Generate the Bearer token
Under Authentication Tokens, find Bearer Token and click Generate (or Regenerate). Copy the token and store it securely.
Step 2: Connect X to Lovable
You can create multiple connections using different Bearer tokens.1
Open X in Connectors
Go to Connectors → App connectors and select X (Twitter).
2
Add a connection
Click Add connection.
3
Configure the connection
- Display name: name the connection, for example
X Prod. This name is only used inside Lovable to identify the connection. - Bearer token: paste your app-only Bearer token from the X Developer Portal.
4
Choose who can access this connection
Under Who can access this connection, decide who in your workspace can use the connection:
- Only you (default): only the person creating the connection can use it and its associated data.
- Invite specific people: only you and explicitly added workspace members can use the connection and its associated data.
- Invite entire workspace: click Invite entire workspace to make the connection available to everyone in your Lovable workspace.
5
Connect
Click Connect. Lovable verifies the token against the X API before saving the connection.
Limitations
The X connector is read-only with an app-only Bearer token. It cannot:- Post, reply, like, repost, or follow on behalf of a user
- Send or read direct messages
- Access protected accounts or a user’s private timeline
- Support per-end-user X login. Each connection uses a single shared Bearer token across all projects linked to it
- Bypass X API rate limits. Cache results, back off on
429responses, and avoid tight polling loops
How to unlink projects from a connection
Editors and above can remove specific projects from a connection without deleting the connection entirely. The connection will remain available for other projects. To unlink projects:1
Open Connectors
Open Connectors, then go to App connectors, and select .
2
Open the connection
Open the connection you want to manage.
3
Select projects
Under Linked projects, check the projects you want to unlink.
4
Confirm
Click Unlink projects and confirm.
How to delete a connection
Workspace admins and owners can delete connections. Other members can delete a connection if they created it, or if they have been explicitly granted access to it. Before deleting, review the Linked projects section to see which projects are currently using the connection. To delete a connection:1
Open Connectors
Open Connectors, then go to App connectors, and select .
2
Open the connection
Open the connection you want to remove.
3
Review linked projects
Review the Linked projects section.
4
Delete
Under Delete this connection, click Delete and confirm.