--- title: Linking code from Bitbucket Cloud sidebarTitle: Bitbucket Cloud --- import BitbucketToken from '/snippets/bitbucket-token.mdx'; import BitbucketAppPassword from '/snippets/bitbucket-app-password.mdx'; import BitbucketSchema from '/snippets/schemas/v3/bitbucket.schema.mdx' ## Examples ```json { "type": "bitbucket", "deploymentType": "cloud", "repos": [ "myWorkspace/myRepo" ] } ``` ```json { "type": "bitbucket", "deploymentType": "cloud", "workspaces": [ "myWorkspace" ] } ``` ```json { "type": "bitbucket", "deploymentType": "cloud", "projects": [ "myProject" ] } ``` ```json { "type": "bitbucket", "deploymentType": "cloud", // Include all repos in my-workspace... "workspaces": [ "myWorkspace" ], // ...except: "exclude": { // repos that are archived "archived": true, // repos that are forks "forks": true, // repos that match these glob patterns "repos": [ "myWorkspace/repo1", "myWorkspace2/*" ] } } ``` ## Authenticating with Bitbucket Cloud In order to index private repositories, you'll need to provide authentication credentials. You can do this using an `App Password` or an `Access Token` Navigate to the [app password creation page](https://bitbucket.org/account/settings/app-passwords/) and create an app password. Ensure that it has the proper permissions for the scope of info you want to fetch (i.e. workspace, project, and/or repo level) ![Bitbucket App Password Permissions](/images/bitbucket_app_password_perms.png) Next, provide your username + app password pair to Sourcebot: Create an access token for the desired scope (repo, project, or workspace). Visit the official [Bitbucket Cloud docs](https://support.atlassian.com/bitbucket-cloud/docs/access-tokens/) for more info. Next, provide the access token to Sourcebot: ## Schema reference [schemas/v3/bitbucket.json](https://github.com/sourcebot-dev/sourcebot/blob/main/schemas/v3/bitbucket.json)