통합 가이드

도움말

브라우저, 프런트엔드, 백엔드에서 hashavatar.app을 직접 사용할 수 있습니다. 모든 아바타 URL은 결정적이므로 같은 식별자와 옵션은 항상 같은 결과를 만듭니다.

기본 URL

간단한 공개 이미지 URL이 필요하면 query endpoint를 사용하세요.

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

경로형 URL

더 깔끔한 임베드 URL을 원하면 path 형식을 사용하세요.

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

HTML 예시

<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 예시

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();

지원되는 매개변수

  • 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

액세서리와 표정 레이어는 캐릭터 스타일 계열에 적용됩니다. planet, rocket, paws, mushroom, cactus, cupcake, pizza, icecream, diamond, coffee-cup, shield 같은 객체 스타일 계열은 accessory=none 및 expression=default로 정규화됩니다.

서명된 스토리지 링크

이 배포에 객체 스토리지가 구성되어 있다면 /v1/avatar/link에서 사전 서명된 스토리지 링크를 요청하세요. 이 endpoint는 생성된 객체를 저장하고 서명 URL, 객체 키, 해시된 캐시 키가 포함된 JSON을 반환합니다. 일반 아바타 응답은 응답 헤더에 서명 링크 메타데이터를 노출하지 않습니다.

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

오픈소스

공개 사이트 소스는 API 저장소에 있고 재사용 가능한 아바타 렌더러는 crates.io에 게시되어 있습니다. 저장소 · crates.io