The “Made by Friends of Google Fonts” badge.
A hosted version of this script will be available. To add it to your project, add this script tag to your project:
<script src="../build/googlefontsbadge.js" async defer onload="gfBadge()"></script>
This will asynchronously load the badge and initialise it once it’s ready.
Alternatively, if you are using a build tool like Browserify, Webpack, etc. you can install the badge as a dependency and initialise it yourself. First, you’ll want to install it as a dependency using npm:
npm install --save https://github.com/googlefonts/friends-badge
Then, require it in your project:
var gfBadge = require('@googlefonts/badge')
// Initialise the badge when you are ready
gfBadge()
To run the project locally, run the following commands in your terminal:
git clone https://github.com/googlefonts/badge googlefonts-badge
cd googlefonts-badge
npm install
Now you can build the distributed version of the file by running:
npm run build
…which uses Browserify to build a stand-alone minified version of the file.