Skip to content

Mobrius/avaicons-mit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Avaicons MIT 🎨

License: MIT Demo

Avaicons is a lightweight JavaScript avatar generator.
Generate SVG avatars from a simple seed in one line of code.

This repo is the MIT-licensed version of Avaicons (client-side library only).
If you want premium styles, CDN, PNG/WebP formats, and a ready-to-use Cloud API, check out πŸ‘‰ https://www.avaicons.com/


πŸš€ Quick Start

Clone and run a local server (opening the HTML file directly won’t work due to browser CORS):

git clone https://github.com/Mobrius/avaicons-mit.git
cd avaicons-mit

For consistent look with initials, load Inter 700 in your page:

<!-- Add this in your HTML <head> -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@700&display=swap" rel="stylesheet">

Fonts are not embedded in the MIT build; external tools may render a different font unless you load one in the page.

Option A β€” Python (no setup)

# Windows
py -m http.server 5173
# macOS/Linux
python3 -m http.server 5173

Open: http://localhost:5173/

Option B β€” Node (no install)

npx serve -l 5173 .
# or
npx http-server -p 5173 .

Open: http://localhost:5173/

Option C β€” Vite (dev server with HMR)

npm init -y
npm i -D vite
# package.json β†’ "scripts": { "dev": "vite" }
npm run dev

Open the printed local URL (default: http://localhost:5173/).


🧩 Use in Node.js / Frontend

import { generateAvatarSVG } from './src/avatarGen.js'

// Identicon example
const svg = generateAvatarSVG('john', { variant: 'identicon', size: 128 })
console.log(svg) // β†’ <svg ...>...</svg>

🎨 Available Styles (MIT)

βœ… initials βœ… identicon βœ… pixel

Looking for face, emoji, or punk? See the Cloud API below.


☁️ Cloud API (avaicons.com)

What you get

Plans & Limits

  • Starter β€” €4.99/mo β†’ 50 req/min, 25k req/month
  • Developer β€” €9.99/mo β†’ 100 req/min, 100k req/month
  • Pro β€” €19.99/mo β†’ 300 req/min, 200k req/month

Quota resets on the 1st of each month (UTC). Each successful avatar response counts as one request.

Security note Do not expose your API key in public client code. Call the API from your backend or use a server-side proxy.


πŸ“Š MIT vs Cloud API

Feature MIT (Free) Cloud API (Starter/Dev/Pro)
initials / identicon / pixel βœ… βœ…
face / emoji / punk ❌ βœ…
SVG output βœ… βœ…
PNG / WebP output ❌ βœ…
CDN + caching ❌ βœ…
Rate limits & quota ❌ βœ…
Uptime & support ❌ βœ…

πŸ“‚ Project Structure

avaicons-mit/
β”œβ”€ index.html        # demo (serve via HTTP, don’t open as file://)
β”œβ”€ src/
β”‚  └─ avatarGen.js   # core generator
β”œβ”€ package.json
β”œβ”€ .gitignore
└─ README.md
  • src/avatarGen.js β†’ core generator
  • index.html β†’ simple demo (requires local server; see Quick Start)

πŸ“œ License

MIT License – free to use, modify, and distribute. For commercial reliability and premium features, upgrade at https://www.avaicons.com/

About

Avaicons MIT 🎨 – A lightweight JavaScript avatar generator. Generate SVG avatars (initials, identicon, pixel) from a simple seed. This is the MIT-licensed open-source version. πŸ‘‰ For premium styles (face, emoji, punk), multiple formats (SVG/PNG/WebP) and a ready-to-use API, check out avaicons.com .

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors