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.
Fork
Follow
Sponsor
No text variant
Available options
SSL support
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.
Required parameters
You must declare a value for each of the following URL parameters:
Option
Description
user
GitHub username that owns the repo/Username to sponsor
repo
GitHub repository to pull the forks and watchers counts
type
Type of button to show: watch, fork, sponsor, or follow
Optional parameters
The following URL parameters are not required. Add them as you wish.
Option
Description
count
Show the optional watchers or forks count: none by default or true
size
Optional flag for using a larger button: none by default or large
text
Optional flag for hiding the text: none by default or false
Deprecated
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.
Limitations
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.
CSS and JavaScript are all included in the same HTML file to reduce complexity.
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!
Open source
The unofficial GitHub buttons are available on GitHub for downloading, forking, or contributing.