Integrationsaalaitig

Hilf

Nutz hashavatar.app direkt us em Browser, dim Frontend oder dim Backend. Jedi Avatar-URL isch deterministisch, drum git di gliich Kennig mit de gliiche Optione immer s gliiche Resultat.

Basis-URL

Nutz de Query-Endpoint, wänn du e eifachi öffentlechi Bild-URL wetsch.

https://hashavatar.app/v1/[email protected]&algorithm=sha512&kind=robot&background=white&accessory=glasses&color=gold&expression=happy&shape=circle&format=webp&size=256

Pfad-URL

Nutz d Pfadform, wänn du saubereri Embed-URLs bevorzugsch.

https://hashavatar.app/avatar/fox/[email protected]/webp

HTML-Bispil

<img
  src="https://hashavatar.app/v1/[email protected]&algorithm=sha512&kind=monster&background=themed&accessory=horns&color=crimson&expression=grumpy&shape=hexagon&format=webp&size=256"
  alt="Generated monster avatar"
/>

JavaScript-Bispil

const avatarUrl = new URL("https://hashavatar.app/v1/avatar");
avatarUrl.search = new URLSearchParams({
  id: user.email,
  algorithm: "sha512",
  kind: "robot",
  background: "white",
  accessory: "glasses",
  color: "gold",
  expression: "happy",
  shape: "circle",
  format: "webp",
  size: "256",
}).toString();

Unterstützti Parameter

  • id: any stable identifier such as an email, username, internal user id, or one-way hash
  • tenant: optional namespace partition for multi-tenant apps
  • style_version: optional style namespace such as v2
  • algorithm: identity hash mode; only sha512 is supported
  • kind: any public hashavatar family, including cat, dog, robot, planet, rocket, frog, panda, cupcake, pizza, octopus, knight, bear, penguin, dragon, ninja, astronaut, diamond, coffee-cup, and shield
  • background: themed, white, black, dark, light, transparent, polka-dot, striped, checkerboard, grid, sunrise, ocean, or starry
  • accessory: none, glasses, hat, headphones, crown, bowtie, eyepatch, scarf, halo, or horns
  • color: default, neon-mint, pastel-pink, crimson, gold, or deep-sea-blue
  • expression: default, happy, grumpy, surprised, sleepy, winking, cool, or crying
  • shape: square, circle, squircle, hexagon, or octagon
  • format: output format; only webp is supported
  • size: from 64 up to 1024

Accessoire- und Usdruck-Layer gelte für charakterartigi Familie. Objektartigi Familie wie planet, rocket, paws, mushroom, cactus, cupcake, pizza, icecream, diamond, coffee-cup und shield werde uf accessory=none und expression=default normalisiert.

Signierti Speicher-Links

Wänn die Deployment Objekt-Speicher konfiguriert hät, fordere en vorsignierte Speicher-Link über /v1/avatar/link aa. De Endpoint speichert s generierte Objekt und git JSON mit signierter URL, Objekt-Key und ghashtem Cache-Key zrugg. Normali Avatar-Antworte gänd kei signierti Link-Metadate i Response-Header use.

GET https://hashavatar.app/v1/avatar/[email protected]&algorithm=sha512&kind=robot&background=white&accessory=glasses&color=gold&expression=happy&shape=circle&format=webp&size=256

Open Source

De Quellcode vo de öffentliche Site liit im API-Repository und de wiederverwendbari Avatar-Renderer isch uf crates.io veröffentlicht. Repository · crates.io