Connect your app to GitLab API
You can connect your Lovable app to GitLab to work with projects, issues, and other data. This lets you build apps like issue dashboards or merge request queues using a shared connection.
Anyone building an app that needs to read or update GitLab data for a team or shared purpose.
Do this, in order
- 1
Go to GitLab and create a personal, group, or project access token.
This token gives Lovable permission to access your GitLab data. Choose the token type that gives the narrowest access needed for your app.
- 2
Select the minimum required permissions for your token, such as 'read_api' for reading data or 'api' for reading and changing data.
This ensures your app only has the necessary access and improves security.
- 3
Set an expiration date for the token and copy it immediately after it's generated.
Expiration dates enhance security, and GitLab will not show the token again after you leave the page.
- 4
In Lovable, go to 'Connectors', select 'GitLab API', and click 'Add connection'.
This starts the process of setting up the connection in your Lovable workspace.
- 5
Choose 'App + chat connector', then paste your GitLab access token into the 'Access token' field.
This tells Lovable how to authenticate with GitLab. Leave the 'Instance URL' empty for GitLab.com, or enter your specific GitLab instance URL if you use Self-Managed or Dedicated.
- 6
Decide who in your Lovable workspace can use this connection and then click 'Connect'.
This controls access to the GitLab data through this connection. Lovable will verify the token before saving.
- 7
In your Lovable project's chat, describe what you want to build using GitLab data.
Lovable will then link the connection to your project and start building the feature you requested.
Paste this into your project
Use our shared GitLab connection to build an issue triage dashboard for the team's projects. Show open issues by label and assignee, and let users create a new issue.
Words decoded
- GitLab REST API
- A standard way for computer programs to talk to GitLab and ask for or send information, like getting a list of projects or creating a new issue.
- Access Token
- A special key that acts like a password, giving Lovable permission to access specific parts of your GitLab account on your behalf.
- Scope
- A specific permission or set of permissions granted to an access token, determining what actions it can perform (e.g., just read data, or also create/update data).
- Instance URL
- The web address of your specific GitLab server. For most people, this is gitlab.com, but some companies have their own private GitLab servers.
- Connector Gateway
- A secure service that Lovable uses to send requests to external services like GitLab, keeping your sensitive access tokens safe and out of your app's code.
Where people get stuck
- Treat your GitLab access token like a password; never put it in a prompt or project code, and only paste it into the secure connection form in Lovable.
- Ensure your GitLab access token is active, not expired, and has the correct permissions (scopes) for what your app needs to do.
- If your GitLab instance is private (behind a VPN or firewall), Lovable might not be able to reach it unless you allow traffic from Lovable's connector gateway IP ranges.
- Be aware of GitLab's API rate limits; if you make too many requests too quickly, GitLab might temporarily block your app.
- Remember that this connection type uses one shared GitLab account; if you need each user of your app to connect their own GitLab account, you'll need the 'App user connector' instead.
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.