Originally, GitHub’s Watch button was used for notification settings (today’s Watch) and repository bookmarking (today’s Star). In August 2012, they split the functionality into two buttons, after these unofficial buttons were released.
As such, for today’s unofficial Watch button, you must add v=2 to the parameters. If you don’t, you’ll get the deprecated button.
No text variant
Example buttons are shown with https:// URLs. While they’re hosted on GitHub Pages, the SSL option is provided via Cloudflare’s free Universal SSL offering.
You must declare a value for each of the following URL parameters:
GitHub username that owns the repo/Username to sponsor
GitHub repository to pull the forks and watchers counts
Type of button to show: watch, fork, sponsor, or follow
The following URL parameters are not required. Add them as you wish.
Show the optional watchers or forks count: none by default or true
Optional flag for using a larger button: none by default or large
Optional flag for hiding the text: none by default or false
Original Watch, aka Star
With the button split in August 2012, GitHub’s API continued to return the Star count for old Watch buttons. Thus, the original unofficial Watch button returns a makeshift Star button.
This deprecated button is still around to avoid breaking every site that currently utilizes these embeds.
For these first versions, functionality is limited and some concessions made:
Mind the GitHub API rate limit which is 60 requests per hour for unauthenticated users.
Width and height must be specified for all buttons (which actually adds some fun control for people like me).
Make sure you adapt the snippets to your needs by modifying the parameters and the title.
All attributes must be passed through via URL parameters.
We include the frameborder and scrolling attributes by default since we cannot know your setup, but you can optionally remove them and set them yourself via CSS:
More refinement and functionality is planned with open-sourcing—any help is always appreciated!
The unofficial GitHub buttons are available on GitHub for downloading, forking, or contributing.