One of the big advantages of integrating with Bitbucket Connect is that users have a simple two-click process for installing your app. The first click is either on the Add button in the Bitbucket app directory, or an Install button embedded on a website, or in an application. The second click approves Bitbucket access permissions for your app and completes the installation.
When users click your install button, the next page that appears requests access permissions to their Bitbucket account. For this reason, be careful that you place the install button in a location users will be able to trust such as a marketing site, product information site, or company sponsored blog post.
The of the button or link must be of the form:
The following rules apply to the URI construction:
Atlaskit makes delivering a beautiful button simple.
The button above is just a simple link styled with the Atlaskit reduced UI pack:
1 2 3 4 5 6 7 8 9 10 11
<html> <head> <link rel="stylesheet" href="https://unpkg.com/@email@example.com/dist/bundle.css" media="all"> <link rel="stylesheet" href="https://unpkg.com/@firstname.lastname@example.org/dist/bundle.css" media="all"> </head> <body> <a href="https://bitbucket.org/site/addons/authorize?descriptor_uri=https://example.com&redirect_uri=https://example.com/welcome"> <button type="button" class="ak-button ak-button__appearance-primary">Connect to Bitbucket</button> </a> </body> </html>
If the user accepts the installation, and the app installs successfully, they will be redirected to the with the query parameter appended. The is an opaque key that references the app's installation for the user or team that installed the app.
If the user does not accept the installation, or the app installation fails, they will be redirected to the with the query parameters and appended. At time of writing the known list of codes are:
|The user has opted not to grant the app access to their account.|
|The descriptor found at is invalid.|
|The install URL or parameters were malformed in some way. Common causes are:
|Something unexpected went wrong.|
Check the parameter passed alongside the parameter for more information about the specific cause. Your page should be resilient to additional error codes being added in future.