Documentation

Everything to integrate Tronche into your projects

API Reference

Explore our complete REST API reference with interactive documentation. Try endpoints directly from your browser.

Open API Reference

Installation

npm install tronche

Usage

Use the core generators directly — no framework required. Each variant provides three functions: generate*Data, render*Svg and generate*Svg for full control.

import { generateBeamSvg } from 'tronche'

const svg = generateBeamSvg('Clara Barton', ['#E07A5F', '#3D405B', '#81B29A', '#F4D06F', '#D8A47F'], {
  size: 120,
})
document.getElementById('app')!.innerHTML = svg

REST API

Generate avatars remotely via our API.

GET/api/avatar/:name
ParameterTypeDefaultDescription
variantstringmarblemarble, beam, pixel, sunset, ring, bauhaus
sizenumber8016 to 512
squarebooleanfalsetrue or false
colorsstringComma-separated hex colors

Examples

curl "https://tronche.cc/api/avatar/Clara%20Barton?variant=beam"

Rate limiting

The free plan allows 100 requests per minute per IP. For higher volume, create an account and use an API key.

Variants

beam avatar preview

beam

Expressive faces

pixel avatar preview

pixel

8×8 pixel art

sunset avatar preview

sunset

Color gradients

ring avatar preview

ring

Concentric circles

bauhaus avatar preview

bauhaus

Geometric shapes

marble avatar preview

marble

Blurry organic shapes