Connecting a Repository
Create an OAuth Application in GitLab
Before connecting, register an OAuth application in the GitLab instance you want to use:
- Go to User Settings → Applications (or Admin Area → Applications for instance-wide apps)
- Set Name to anything recognisable, e.g.
Cratly Editor - Set Redirect URI to your deployment URL +
/callback, e.g.:If you also want to use the editor locally during development, add a second redirect URI on its own line:https://cratly.example.com/callbackhttp://localhost:5174/callback - Under Scopes, enable
api - Save — copy the Application ID (this is the client ID you will enter in the editor)
Why the api scope?
The api scope is the minimum GitLab offers that allows reading and writing repository content. The editor needs it to:
- Read file trees and file contents
- Create commits (save changes)
- Read and create branches
- Open merge requests
GitLab does not provide a narrower scope that covers repository writes. The read_repository and write_repository scopes cover Git operations over HTTP but not the API endpoints the editor relies on for branch management and merge requests.
Your access token is stored only in your browser's session storage and is never sent anywhere other than your GitLab instance.
Instance-wide vs. user-level applications
| Type | Where to register | Who can use it |
|---|---|---|
| User-level | User Settings → Applications | Only your account |
| Instance-wide | Admin Area → Applications | Any user on the instance |
For a shared deployment (e.g. a team using the same Cratly Editor URL), register an instance-wide application so each team member can authenticate with their own GitLab account.
Connect from the Editor
Open the editor and fill in the connection form:
| Field | Value |
|---|---|
| GitLab Instance URL | e.g. https://gitlab.com or your self-hosted URL |
| Application ID | The client ID from the step above |
| Repository Path | group/project as shown in the GitLab URL |
Click Connect via OAuth — you will be redirected to GitLab to authorise, then returned automatically.
Saved Connections
After a successful connection the credentials are saved in your browser's local storage. On the next visit you can reconnect with one click from the saved list.
To remove a saved connection, click the × next to it.