getavataaars

Generate an avatar by mixing-and-matching various elements.

Usage no npm install needed!

<script type="module">
  import getavataaars from 'https://cdn.skypack.dev/getavataaars';
</script>

README

Get Avataaars

Generate an avatar by mixing-and-matching various elements.

Build status Azure DevOps tests Azure DevOps coverage Quality Gate Status Maintainability Rating MIT License npm

Usage

After installing, simply import Get Avataaars in your file.

const avatars = require("getavataaars");

Consume the generateAvatar() API to get an avatar URL that you can use directly as an image. Supply the settings object to customize your avatar. All settings are pretty self-explanatory and matches the web editor. Adding the following code, for example:

var image = avatars.generateAvatar({
            Hair: avatars.Hair.Eyepatch,
            Accessories: avatars.Accessories.Kurt,
            Eyebrow: avatars.Eyebrow.Angry
        }); 

Would produce the following image:
image

Credits

Avataaars designed by Pablo Stanley.
Web editor by Fang-Pen Lin.
React npm package by Fang-Pen Lin.
This NPM package is developed by Clyde D'Souza.