Quick answer
Keep a versioned SVG or high-resolution PNG master. Generate derivatives in a deterministic script rather than hand-editing each size.
- Last verified
- July 31, 2026
- Evidence
- Primary documentation plus a route-specific implementation example
- Primary sources
- 2
Choose one source of truth
Keep a versioned SVG or high-resolution PNG master. Generate derivatives in a deterministic script rather than hand-editing each size.
Connected next stepFavicon ICO Format: Inside Multi-Resolution Icon Files for the closest prerequisite or comparison.
Validate in CI
Check square dimensions, file decoding, alpha behavior, maximum byte sizes, required manifest entries, and the HTML references produced by the build.
Connected next stepSafari Pinned Tab Icons, SVG Masks and Touch Icons for the next connected implementation decision.
Monitor production
A post-deploy check should fetch the homepage, resolve icon links, and verify public responses. This catches CDN path errors that build-time tests cannot see.
Connected next stepOpen the most relevant production tool and verify the decision with a working output.
Call the versioned package API
POST a PNG, JPG, WebP, GIF, or BMP file to /api/v1/package as multipart form data. The service applies EXIF orientation, contains the source inside a transparent 512×512 square, and returns the same documented ZIP structure used by the browser workflow.
Send name, legacy, and maskable fields with the upload. The response includes X-Favicon-API-Version: v1; /api/v1/health exposes the current service version and content update date. SVG sources remain a browser-studio workflow because safe vector preservation needs its separate validation path.
Define a deterministic build contract
Pin the rendering library, source file, output dimensions, resampling method, color profile policy, filenames, and manifest template. The same commit should produce the same file inventory and equivalent decoded pixels.
Store generated artifacts or checksums when release reproducibility matters. Fail the build on non-square input, missing alpha policy, unexpected animation, active SVG content, or absent required outputs.
Test deployment after generation
CI success proves the archive was created, not that the public site serves it. Add post-deploy checks for status, redirects, MIME type, dimensions, ICO frames, manifest parsing, and resolved URLs.
Publish the report as a build artifact and link it to the deployed commit. A small evidence file makes regressions easier to diagnose than a screenshot of a green pipeline.
Production file tree and code: Automated package build and evidence files
This CI layout separates the versioned source, generated archive, and machine-readable inspection report so releases can compare outputs rather than trust filenames.
source/brand-mark.png
build/favicon-now-package.zip
reports/favicon-package-check.json
.github/workflows/favicon.ymlcurl --fail-with-body \
-X POST https://favicon.now/api/v1/package \
-F file=@source/brand-mark.png \
-F name='Example Site' \
-F legacy=false \
-F maskable=true \
--output build/favicon-now-package.zipReview the headings, sources, implementation artifact, and update record for this guide as structured JSON.
Download guide evidence ↓- Guide
- Favicon API Automation: Deterministic Generation in CI/CD
- Coverage
- Client behavior can change by browser, operating system, platform version, cache state and deployment configuration. Unperformed manual observations are not claimed.
Questions, answered
Should generated icons be committed?+
Either approach works. Commit for simple static hosting; generate during builds when the toolchain is stable and reproducible.
What should break the build?+
Missing core files, invalid manifests, failed decoding, wrong dimensions, or head links that target absent assets.
