Connect your app to X (Twitter)
You can connect your Lovable app to X (Twitter) to read public information like user profiles and recent posts. This lets you build features like dashboards or search tools within your app.
Anyone building a Lovable app who wants to show public X (Twitter) data without posting or interacting on behalf of a user.
Do this, in order
- 1
Go to the X Developer Portal and sign in.
This is where you manage your X apps and get the special code needed to connect to Lovable.
- 2
Create a new project and app, or open an existing one.
You need an X app to generate the unique code that allows Lovable to access X's public data.
- 3
Find the 'Keys and tokens' section in your app settings.
This is where you'll generate the specific code (Bearer token) for your Lovable connection.
- 4
Generate a 'Bearer Token' and copy it, keeping it secret.
This token is like a password for your app to access X data; you'll need it for the next step in Lovable.
- 5
In Lovable, go to 'Connectors' and select 'X (Twitter)'.
This is where you'll tell Lovable how to connect to your X app using the token you just got.
- 6
Click 'Add connection', give it a name like 'X Prod', and paste your Bearer token.
The name helps you identify this connection later, and the token is essential for Lovable to authenticate with X.
- 7
Decide who in your workspace can use this connection, then click 'Connect'.
You can share access with others or keep it private, and Lovable will check if the token works before saving.
Paste this into your project
Use X and build a page that shows profile info for an X username.
Words decoded
- Bearer token
- A special, secret code that acts like a key, allowing your Lovable app to prove its identity to X and access public information without needing a username or password.
- App-only
- This means the connection only allows your Lovable app to do things that don't involve a specific user's account, like reading public posts, not posting or liking things on someone's behalf.
- Read-only access
- Your Lovable app can only look at and retrieve public information from X, but it cannot change anything, post new content, or interact with accounts.
- X API v2
- This is the specific set of rules and tools that X provides for other software (like your Lovable app) to communicate with its platform and get data.
- Workspace
- Your personal or team area within Lovable where you build and manage all your projects and connections.
Where people get stuck
- Never share your Bearer token publicly, as it acts like a password for your X app's access.
- Remember that this connection is read-only; your app cannot post, like, follow, or send direct messages.
- This connector cannot access private accounts or protected user data.
- You must have an X Developer account and be a Lovable workspace owner or admin to set up this connection.
- If you change your Bearer token in X, you must update the connection in Lovable for your apps to continue working.
The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.