What are badges?

Badges are the uniform way of displaying the tags to the repository to ensure better quality code. A list of badges is included in the Readme.MD file of your repository. 

Building badges helps to improve the readability of the repository. They provide visual information that portrays different colors.

BrowserStack Code Quality Badges

BrowserStack Code Quality badges can be used to promote the health of your repository on external websites like GitHub and Bitbucket.

Currently, BrowserStack Code Quality supports two badges:

  1. Rating – This badge shows the Overall Rating of your repository . Know more about BrowserStack Code Quality ratings here.
  2. Quality Gate: This badge shows whether the repository has passed or failed the quality standards set by you. Know more about quality gate here.

How to add badges to your repository?

To see badges, add this command to the Readme.MD file in your repository.

![BrowserStack Code Quality](https://YOUR_DOMAIN/api/badges?repository_uid=REPOSITORYUID&type=rating&token=BrowserStack_Code_Quality_ACCESS_TOKEN)

Read more information about generating repository uid and BrowserStack Code Quality Access Token.

Below are the sample values displayed as an example:

## BrowserStack Code Quality: Quality Gate
![BrowserStack Code Quality](http://189.59.79.970:4500/api/badges?type=qualityGate&token=eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MTYyNjk0MzU3NjA3MCwiaWF0IjoxNjI2OTQzNTc2fQ.aI80WAMwXAHsIsd0dlbmqE9X3Ytc7BqYqb04-doZPNHFLLvKf0Fc5G1wLRU11YubjVr9svkBUh9ZOU_O3toBfg&repositoryUid=4c8569cb090c89a28ce35817e8fc8d14)

Check out badges-related API documentation here.