{"_id":"facehash","_rev":"7-484540ba2df6b773091b69f015e877da","name":"facehash","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.2":{"name":"facehash","version":"0.0.2","keywords":["facehash","avatar","react","react-avatar","deterministic","generative","profile-picture","profile-avatar","identicon","hash","face","3d","interactive","gradient","typescript","accessible","headless","unstyled","css","tailwind","boring-avatars","dicebear","jdenticon","gravatar-alternative","user-avatar","default-avatar"],"author":{"name":"Cossistant team"},"license":"MIT","_id":"facehash@0.0.2","maintainers":[{"name":"frenchriera","email":"frenchriera@icloud.com"}],"homepage":"https://cossistant.com","bugs":{"url":"https://github.com/cossistantcom/cossistant/issues"},"dist":{"shasum":"1fa4a8e10f20289abde3e812da03e57390795b5a","tarball":"https://registry.npmjs.org/facehash/-/facehash-0.0.2.tgz","fileCount":6,"integrity":"sha512-HOCCeTAeVns7ezA38b/FbPf5eTs1csrDGkoEDNjRD7XMv3YVGdwTKt/8YNXdW+gVbRtknvL7Jf50u3j4JoDTZw==","signatures":[{"sig":"MEUCIEln/j2vVEzdEhTojzu7h7GximeKB9nc2AZgQqUsP4hKAiEAyvuy80zk2JV0GitgyzEdE3KQymo1eC5RoPv1peC7Q2I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73176},"main":"./index.js","type":"module","types":"./index.d.ts","module":"./index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js"}},"gitHead":"31a3da5c073ba9eae6f922e60a59bde572d830f8","private":false,"_npmUser":{"name":"frenchriera","email":"frenchriera@icloud.com"},"repository":{"url":"git+https://github.com/cossistantcom/cossistant.git","type":"git","directory":"packages/facehash"},"_npmVersion":"10.9.4","description":"Deterministic avatar faces from any string. Lightweight, interactive, pure CSS. Works with any framework.","directories":{},"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"react":">=18 <20","react-dom":">=18 <20","@types/react":""},"peerDependenciesMeta":{"@types/react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/facehash_0.0.2_1769682811883_0.695715122607419","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"facehash","version":"0.0.3","keywords":["facehash","avatar","react","react-avatar","deterministic","generative","profile-picture","profile-avatar","identicon","hash","face","3d","interactive","gradient","typescript","accessible","headless","unstyled","css","tailwind","boring-avatars","dicebear","jdenticon","gravatar-alternative","user-avatar","default-avatar"],"author":{"name":"Cossistant team"},"license":"MIT","_id":"facehash@0.0.3","maintainers":[{"name":"frenchriera","email":"frenchriera@icloud.com"}],"homepage":"https://cossistant.com","bugs":{"url":"https://github.com/cossistantcom/cossistant/issues"},"dist":{"shasum":"f8dc884bebbfca1a3398e62804e6c1f2be40bc8f","tarball":"https://registry.npmjs.org/facehash/-/facehash-0.0.3.tgz","fileCount":8,"integrity":"sha512-YK7y3HfamL4CtRc9Y4lyQCY2x6HbFX8eZzyAzzfp4BVcmg3EJYnTZum6ZSE65PA16fhNG2e0v+QZTgqRUUhMYg==","signatures":[{"sig":"MEQCIAiR4AVbFI3U+fo5H1SoPgRlmHovXckv1gNVjKTgPnOxAiAOdGdR55wYcD4S2VwEAw9aKXWtD74fOcIubiq95tyz2w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":82486},"main":"./src/index.ts","type":"module","types":"./src/index.ts","module":"./src/index.ts","exports":{".":"./src/index.ts"},"gitHead":"16e59f16e62436bb5d2ffa55f5cea2aed316dcdb","private":false,"scripts":{"lint":"biome check .","build":"tsdown && bun run prepare-package","pub:beta":"bun run build && npm publish --access public --tag beta --no-git-checks","check-types":"tsc --noEmit --project tsconfig.json","pub:release":"bun run build && npm publish --access public","prepare-package":"bun ../../scripts/prepare-package.ts"},"_npmUser":{"name":"frenchriera","email":"frenchriera@icloud.com"},"repository":{"url":"git+https://github.com/cossistantcom/cossistant.git","type":"git","directory":"packages/facehash"},"_npmVersion":"10.9.4","description":"Deterministic avatar faces from any string. Lightweight, interactive, pure CSS. Works with any framework.","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public","directory":"dist"},"_hasShrinkwrap":false,"devDependencies":{"@cossistant/typescript-config":"workspace:*"},"peerDependencies":{"react":">=18 <20","react-dom":">=18 <20","@types/react":""},"peerDependenciesMeta":{"@types/react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/facehash_0.0.3_1769685834539_0.4340795819709682","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"facehash","version":"0.0.4","keywords":["facehash","avatar","react","react-avatar","nextjs","next","og-image","image-generation","deterministic","generative","profile-picture","profile-avatar","identicon","hash","face","3d","interactive","gradient","typescript","accessible","headless","unstyled","css","tailwind","boring-avatars","dicebear","jdenticon","gravatar-alternative","user-avatar","default-avatar"],"author":{"name":"Cossistant team"},"license":"MIT","_id":"facehash@0.0.4","maintainers":[{"name":"frenchriera","email":"frenchriera@icloud.com"}],"homepage":"https://facehash.dev","bugs":{"url":"https://github.com/cossistantcom/cossistant/issues"},"dist":{"shasum":"d8c122d126bda4b971b3260dee558318c617f65a","tarball":"https://registry.npmjs.org/facehash/-/facehash-0.0.4.tgz","fileCount":12,"integrity":"sha512-Shc2NJ0P2hKuWhwgF7nefNjhxcyUsDz01Y4ZphSEvCIg2VTXqqXbJJALIZ+KCuMTTbjZ5iM0y9KUoV5mLIcJYA==","signatures":[{"sig":"MEQCICkxckG9oZxIk8FruFwtbZoCsp1v5xZi34w2j1s4VQE2AiBQFgy/+PUrZppMA+v1JlvhSeMxSFvyvxUWfsYvFb4plg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":110535},"main":"./index.js","type":"module","types":"./index.d.ts","module":"./index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js"},"./next":{"types":"./next/index.d.ts","import":"./next/index.js"}},"gitHead":"6916ffafc5800bed86e0680c21fac20f8482dbec","private":false,"_npmUser":{"name":"frenchriera","email":"frenchriera@icloud.com"},"repository":{"url":"git+https://github.com/cossistantcom/cossistant.git","type":"git","directory":"packages/facehash"},"_npmVersion":"10.9.4","description":"Deterministic avatar faces from any string. Lightweight, interactive, pure CSS. Works with any framework.","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"next":">=15","react":">=18 <20","react-dom":">=18 <20","@types/react":""},"peerDependenciesMeta":{"next":{"optional":true},"@types/react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/facehash_0.0.4_1769749631945_0.9500085384352595","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"facehash","version":"0.0.5","keywords":["facehash","avatar","react","react-avatar","nextjs","next","og-image","image-generation","deterministic","generative","profile-picture","profile-avatar","identicon","hash","face","3d","interactive","gradient","typescript","accessible","headless","unstyled","css","tailwind","boring-avatars","dicebear","jdenticon","gravatar-alternative","user-avatar","default-avatar"],"author":{"name":"Cossistant team"},"license":"MIT","_id":"facehash@0.0.5","maintainers":[{"name":"frenchriera","email":"frenchriera@icloud.com"}],"homepage":"https://facehash.dev","bugs":{"url":"https://github.com/cossistantcom/cossistant/issues"},"dist":{"shasum":"ebb09c97c721a488a92ef32ca60c017d32cc6afc","tarball":"https://registry.npmjs.org/facehash/-/facehash-0.0.5.tgz","fileCount":12,"integrity":"sha512-txM9veJ9IPNWsimpHD+Qqr5aFcSdgJPBY2oTRzRgIfSPcLxwZQY4++7vv9fHjco25ErUxC9pdq9tPB9NK1UhTQ==","signatures":[{"sig":"MEQCIA58YR1zGpMGJ9IN6YNdRR4dpfxRwQsq17a5mO2UzYOaAiBPfP+T8BVkvcATRyir/LtEM7xmxhdBtTDBqZ/XvQkE2w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":111730},"main":"./index.js","type":"module","types":"./index.d.ts","module":"./index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js"},"./next":{"types":"./next/index.d.ts","import":"./next/index.js"}},"gitHead":"9f99b84972db8b528abb6833b59c76877f268dfa","private":false,"_npmUser":{"name":"frenchriera","email":"frenchriera@icloud.com"},"repository":{"url":"git+https://github.com/cossistantcom/cossistant.git","type":"git","directory":"packages/facehash"},"_npmVersion":"10.9.4","description":"Deterministic avatar faces from any string. Lightweight, interactive, pure CSS. Works with any framework.","directories":{},"_nodeVersion":"22.21.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"next":">=15","react":">=18 <20","react-dom":">=18 <20","@types/react":""},"peerDependenciesMeta":{"next":{"optional":true},"@types/react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/facehash_0.0.5_1769772680895_0.7019996874328474","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"facehash","version":"0.0.6","keywords":["facehash","avatar","react","react-avatar","nextjs","next","og-image","image-generation","deterministic","generative","profile-picture","profile-avatar","identicon","hash","face","3d","interactive","gradient","typescript","accessible","headless","unstyled","css","tailwind","boring-avatars","dicebear","jdenticon","gravatar-alternative","user-avatar","default-avatar"],"author":{"name":"Cossistant team"},"license":"MIT","_id":"facehash@0.0.6","maintainers":[{"name":"frenchriera","email":"frenchriera@icloud.com"}],"homepage":"https://facehash.dev","bugs":{"url":"https://github.com/cossistantcom/cossistant/issues"},"dist":{"shasum":"adb7f8595a1c77baf970fbce68e55506e8223d1f","tarball":"https://registry.npmjs.org/facehash/-/facehash-0.0.6.tgz","fileCount":12,"integrity":"sha512-CXGek57y73srl0LjTJi/JygknKO2aaGy8NtVKHpk2uoXxSrifqow0pWbfx6AslDruZdj3f5eZSQWrlqxhPDR4w==","signatures":[{"sig":"MEQCIGMAjZzJy9Q6iEdzzx1nlP7HYaUP2tyw32DRK3gTfj/MAiA63Yi9x9xxkErdJainUpjZzFVTZLLz/glkt4LaZ9PSvA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":121735},"main":"./index.js","type":"module","types":"./index.d.ts","module":"./index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js"},"./next":{"types":"./next/index.d.ts","import":"./next/index.js"}},"gitHead":"14e290f7319d8c279145a6b4949cec40ae39b972","private":false,"_npmUser":{"name":"frenchriera","email":"frenchriera@icloud.com"},"repository":{"url":"git+https://github.com/cossistantcom/cossistant.git","type":"git","directory":"packages/facehash"},"_npmVersion":"10.9.4","description":"Deterministic avatar faces from any string. Lightweight, interactive, pure CSS. Works with any framework.","directories":{},"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"next":">=15","react":">=18 <20","react-dom":">=18 <20","@types/react":""},"peerDependenciesMeta":{"next":{"optional":true},"@types/react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/facehash_0.0.6_1770265176714_0.6076032288207178","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"facehash","version":"0.0.7","keywords":["facehash","avatar","react","react-avatar","nextjs","next","og-image","image-generation","deterministic","generative","profile-picture","profile-avatar","identicon","hash","face","3d","interactive","gradient","typescript","accessible","headless","unstyled","css","tailwind","boring-avatars","dicebear","jdenticon","gravatar-alternative","user-avatar","default-avatar"],"author":{"name":"Cossistant team"},"license":"MIT","_id":"facehash@0.0.7","maintainers":[{"name":"frenchriera","email":"frenchriera@icloud.com"}],"homepage":"https://facehash.dev","bugs":{"url":"https://github.com/cossistantcom/cossistant/issues"},"dist":{"shasum":"b11789710ed96a6dcade36ee5a24b3de887f3332","tarball":"https://registry.npmjs.org/facehash/-/facehash-0.0.7.tgz","fileCount":12,"integrity":"sha512-P4fw6z5DIGMbjtqEaOw7fYvYpQetSOSJOfqy3xuET7cDUI6f9CKlSX0UZIYNrtsPpCoz3LoPP5E8bNbpZBP30A==","signatures":[{"sig":"MEYCIQDOMFar/A2z6tfI+q7pEyPbcTxZ7A3JEOqQsPjmU+t4LQIhAJ3DnVWWw6gGhV/eB+Rd+hPDOeeNZ+OcJdR0tGGuMqpT","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":120921},"main":"./index.js","type":"module","types":"./index.d.ts","module":"./index.js","exports":{".":{"types":"./index.d.ts","import":"./index.js"},"./next":{"types":"./next/index.d.ts","import":"./next/index.js"}},"gitHead":"dcfd229523f6f22f9f7d31b443e238448982a1d6","private":false,"_npmUser":{"name":"frenchriera","email":"frenchriera@icloud.com"},"repository":{"url":"git+https://github.com/cossistantcom/cossistant.git","type":"git","directory":"packages/facehash"},"_npmVersion":"10.9.4","description":"Deterministic avatar faces from any string. Lightweight, interactive, pure CSS. Works with any framework.","directories":{},"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"next":">=15","react":">=18 <20","react-dom":">=18 <20","@types/react":""},"peerDependenciesMeta":{"next":{"optional":true},"@types/react":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/facehash_0.0.7_1770464308505_0.14198441419220198","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"facehash","type":"module","version":"0.1.0","private":false,"author":{"name":"Cossistant team"},"description":"Deterministic avatar faces from any string. Lightweight, interactive, pure CSS. Works with any framework.","keywords":["facehash","avatar","react","react-avatar","nextjs","next","og-image","image-generation","deterministic","generative","profile-picture","profile-avatar","identicon","hash","face","3d","interactive","gradient","typescript","accessible","headless","unstyled","css","tailwind","boring-avatars","dicebear","jdenticon","gravatar-alternative","user-avatar","default-avatar"],"bugs":{"url":"https://github.com/cossistantcom/cossistant/issues"},"repository":{"type":"git","url":"git+https://github.com/cossistantcom/cossistant.git","directory":"packages/facehash"},"license":"MIT","homepage":"https://facehash.dev","exports":{".":{"types":"./index.d.ts","import":"./index.js"},"./next":{"types":"./next/index.d.ts","import":"./next/index.js"}},"main":"./index.js","module":"./index.js","types":"./index.d.ts","peerDependencies":{"react":">=18 <20","react-dom":">=18 <20","@types/react":"","next":">=15"},"peerDependenciesMeta":{"@types/react":{"optional":true},"next":{"optional":true}},"publishConfig":{"access":"public"},"_id":"facehash@0.1.0","gitHead":"22e75802c0868e700a0a37940181b45d5f5609ba","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-tv/QVZjLvEXHssqBaJECq+kRLFwwhd017PKk8ucT7aLingL2OZ5zEqKwPMHmT9+YQO92MVFWGZQP6vxV+P5vrQ==","shasum":"4887ce9eda7debfe7578ebca188cabdbe1b7bd40","tarball":"https://registry.npmjs.org/facehash/-/facehash-0.1.0.tgz","fileCount":12,"unpackedSize":98536,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCKTINzaaZvIQV8UNOlf40b5hVM4QV2ylBgUcQM8LBbLQIgDzDQaSbRmbA51MLFZmLHAtSwc4nZwDUXBrrQ3Ey5wSE="}]},"_npmUser":{"name":"frenchriera","email":"frenchriera@icloud.com"},"directories":{},"maintainers":[{"name":"frenchriera","email":"frenchriera@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/facehash_0.1.0_1771037375536_0.14412833697358507"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-29T10:33:31.771Z","modified":"2026-02-14T02:49:35.800Z","0.0.2":"2026-01-29T10:33:32.039Z","0.0.3":"2026-01-29T11:23:54.690Z","0.0.4":"2026-01-30T05:07:12.093Z","0.0.5":"2026-01-30T11:31:21.068Z","0.0.6":"2026-02-05T04:19:36.955Z","0.0.7":"2026-02-07T11:38:28.686Z","0.1.0":"2026-02-14T02:49:35.684Z"},"bugs":{"url":"https://github.com/cossistantcom/cossistant/issues"},"author":{"name":"Cossistant team"},"license":"MIT","homepage":"https://facehash.dev","keywords":["facehash","avatar","react","react-avatar","nextjs","next","og-image","image-generation","deterministic","generative","profile-picture","profile-avatar","identicon","hash","face","3d","interactive","gradient","typescript","accessible","headless","unstyled","css","tailwind","boring-avatars","dicebear","jdenticon","gravatar-alternative","user-avatar","default-avatar"],"repository":{"type":"git","url":"git+https://github.com/cossistantcom/cossistant.git","directory":"packages/facehash"},"description":"Deterministic avatar faces from any string. Lightweight, interactive, pure CSS. Works with any framework.","maintainers":[{"name":"frenchriera","email":"frenchriera@icloud.com"}],"readme":"# facehash\n\nDeterministic avatar faces from any string. **Lightweight (~3KB gzipped), zero dependencies**, works with React 18/19 and Next.js 15/16.\n\n<p align=\"center\">\n  <img src=\"https://facehash.dev/og-image.png\" alt=\"facehash examples\" width=\"600\" />\n</p>\n\n## Installation\n\n```bash\nnpm install facehash\n```\n\n## Quick Start\n\n### React Component\n\n```tsx\nimport { Facehash } from \"facehash\";\n\n<Facehash name=\"john@example.com\" />\n```\n\nSame string = same face. Always.\n\n### Next.js API Route (Image Generation)\n\nGenerate PNG avatar images via API endpoint — perfect for emails, Open Graph images, or anywhere you need a URL.\n\n```tsx\n// app/api/avatar/route.ts\nimport { toFacehashHandler } from \"facehash/next\";\n\nexport const { GET } = toFacehashHandler();\n```\n\nThen use it:\n```\nGET /api/avatar?name=john@example.com\nGET /api/avatar?name=john&size=200&variant=solid\n```\n\nReturns a PNG image. Cached for 1 year by default.\n\n## Props\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| `name` | `string` | Required | String to generate face from |\n| `size` | `number \\| string` | `40` | Size in pixels or CSS units |\n| `colors` | `string[]` | - | Array of hex/hsl colors |\n| `colorClasses` | `string[]` | - | Array of Tailwind classes (use instead of `colors`) |\n| `variant` | `\"gradient\" \\| \"solid\"` | `\"gradient\"` | Background style |\n| `intensity3d` | `\"none\" \\| \"subtle\" \\| \"medium\" \\| \"dramatic\"` | `\"dramatic\"` | 3D rotation effect |\n| `interactive` | `boolean` | `true` | Animate on hover |\n| `showInitial` | `boolean` | `true` | Show first letter below face |\n| `onRenderMouth` | `() => React.ReactNode` | - | Custom mouth renderer (replaces initial) |\n| `enableBlink` | `boolean` | `false` | Enable random eye blinking animation |\n\n## Examples\n\n### Custom Colors\n\n```tsx\n<Facehash\n  name=\"alice\"\n  colors={[\"#264653\", \"#2a9d8f\", \"#e9c46a\", \"#f4a261\", \"#e76f51\"]}\n/>\n```\n\n### With Tailwind Classes\n\n```tsx\n<Facehash\n  name=\"bob\"\n  colorClasses={[\"bg-pink-500\", \"bg-blue-500\", \"bg-green-500\"]}\n  className=\"rounded-full\"\n/>\n```\n\n### Flat Style (No 3D)\n\n```tsx\n<Facehash name=\"charlie\" intensity3d=\"none\" variant=\"solid\" />\n```\n\n### Without Initial Letter\n\n```tsx\n<Facehash name=\"diana\" showInitial={false} />\n```\n\n### Eye Blinking Animation\n\nAdd a subtle, chaotic blinking effect to make faces feel alive:\n\n```tsx\n<Facehash name=\"alive\" enableBlink />\n```\n\nThe blinking is pure CSS with randomized timing per eye — each eye blinks at different intervals for a natural, chaotic effect.\n\n### Custom Mouth Renderer\n\nReplace the initial letter with any custom component:\n\n```tsx\nimport { Facehash } from \"facehash\";\nimport { Spinner } from \"./spinner\"; // Your loading spinner\n\n// Show a spinner as the \"mouth\"\n<Facehash\n  name=\"loading\"\n  onRenderMouth={() => <Spinner size={16} />}\n/>\n\n// Custom icon\n<Facehash\n  name=\"bot\"\n  onRenderMouth={() => <BotIcon className=\"w-4 h-4\" />}\n/>\n\n// Combine with blinking for a \"thinking\" avatar\n<Facehash\n  name=\"thinking\"\n  enableBlink\n  onRenderMouth={() => <Spinner size={12} />}\n/>\n```\n\n## Avatar with Image Fallback\n\nFor image avatars that fall back to Facehash when the image fails:\n\n```tsx\nimport { Avatar, AvatarImage, AvatarFallback } from \"facehash\";\n\n<Avatar style={{ width: 40, height: 40, borderRadius: \"50%\", overflow: \"hidden\" }}>\n  <AvatarImage src=\"/photo.jpg\" alt=\"User\" />\n  <AvatarFallback name=\"john@example.com\" />\n</Avatar>\n```\n\n`AvatarFallback` renders a `Facehash` by default. For initials instead:\n\n```tsx\n<AvatarFallback name=\"John Doe\" facehash={false} />\n```\n\n## Next.js API Route\n\nThe `facehash/next` export provides a route handler factory for generating avatar images server-side. This is useful for:\n\n- Email avatars (where you need an image URL)\n- Open Graph / social sharing images\n- Any context where you need a URL instead of a React component\n\n### Basic Setup\n\n```tsx\n// app/api/avatar/route.ts\nimport { toFacehashHandler } from \"facehash/next\";\n\nexport const { GET } = toFacehashHandler();\n```\n\n### With Custom Defaults\n\n```tsx\nexport const { GET } = toFacehashHandler({\n  size: 200,           // Default image size (default: 400)\n  variant: \"solid\",    // \"gradient\" | \"solid\" (default: \"gradient\")\n  showInitial: false,  // Show first letter (default: true)\n  colors: [\"#ff6b6b\", \"#4ecdc4\", \"#45b7d1\"],  // Custom color palette\n  cacheControl: \"public, max-age=86400\",      // Custom cache header\n});\n```\n\n### Query Parameters\n\nAll options can be overridden via URL query parameters:\n\n| Parameter | Type | Description |\n|-----------|------|-------------|\n| `name` | `string` | **Required.** String to generate avatar from |\n| `size` | `number` | Image size in pixels (16-2000) |\n| `variant` | `string` | `\"gradient\"` or `\"solid\"` |\n| `showInitial` | `boolean` | `\"true\"` or `\"false\"` |\n| `colors` | `string` | Comma-separated hex colors (e.g., `#ff0000,#00ff00`) |\n\n### Example URLs\n\n```\n/api/avatar?name=john@example.com\n/api/avatar?name=Alice&size=128\n/api/avatar?name=Bob&variant=solid&showInitial=false\n/api/avatar?name=Team&colors=%23ff6b6b,%234ecdc4,%2345b7d1\n```\n\n### Caching\n\nBy default, responses include `Cache-Control: public, max-age=31536000, immutable` (1 year). Same name always generates the same image, so aggressive caching is safe.\n\n## Exports\n\n```tsx\n// Main component\nimport { Facehash } from \"facehash\";\n\n// Avatar compound components\nimport { Avatar, AvatarImage, AvatarFallback } from \"facehash\";\n\n// Individual face components (for custom use)\nimport { RoundFace, CrossFace, LineFace, CurvedFace, FACES } from \"facehash\";\n\n// Utilities\nimport { stringHash } from \"facehash\";\n\n// Types\nimport type { FacehashProps, AvatarProps, AvatarFallbackProps, AvatarImageProps } from \"facehash\";\n\n// Next.js route handler (facehash/next)\nimport { toFacehashHandler } from \"facehash/next\";\nimport type { FacehashHandlerOptions, FacehashHandler } from \"facehash/next\";\n```\n\n## License\n\nMIT — Built by [Cossistant](https://cossistant.com)\n","readmeFilename":"README.md"}