Vue GitHub Buttons is a Vue 2 component library that provides pre-styled, functional components for displaying various GitHub buttons, such as 'watch', 'star', 'fork', and 'follow', complete with dynamic count fetching from the GitHub API. The latest stable version is 3.1.0, released in April 2020. Given the lack of activity since then, the project is considered abandoned, and no further updates or security patches are anticipated. Key features include built-in caching to mitigate GitHub API rate limits, and dedicated integration modules for Nuxt.js and VuePress 1.x. Version 3.0.0 marked a shift from Axios to the native Fetch API for network requests, which may necessitate polyfills for older browser environments.
npm install vue-github-buttonsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to install, import, and register `vue-github-buttons` as a Vue plugin. It then uses the provided components like `<gh-btns-star>`, `<gh-btns-follow>`, and `<gh-btns-fork>` within a basic Vue application, showing how to display counts and configure basic options.
Ensure your project uses Vue 2. If migrating to Vue 3, you will need to find an alternative library or custom implement GitHub buttons.
For older browser support, include a global Fetch polyfill (e.g., `whatwg-fetch` or `cross-fetch`) in your project's entry point before `vue-github-buttons` is initialized.
Always enable the `useCache: true` plugin option (which is the default) to leverage session storage caching and minimize API calls. For server-side rendering (SSR), consider implementing server-side caching or proxying requests through your own backend.
Upgrade to v3.1.0 or later. If issues persist in specific SSR setups, ensure your Node.js environment explicitly polyfills the `fetch` API globally if it's not natively available or if the internal polyfill isn't effective.
Assess the long-term viability for your project. For ongoing projects, consider migrating to an actively maintained alternative or implementing the GitHub buttons functionality directly to ensure future compatibility and security.
Upgrade to version 2.0.3 or higher, where this specific SSR rendering bug was addressed and fixed.
For client-side, include a Fetch polyfill (e.g., `whatwg-fetch`) in your project. For Node.js (SSR), upgrade to v3.1.0 or newer which includes an internal `node-fetch` polyfill.
Ensure `useCache: true` is enabled in the plugin options. For production applications with high traffic or many buttons, consider proxying GitHub API requests through your own backend to manage caching and potentially use a personal access token for higher limits.