Skip to main content
The SDK proxies your AgentShop-generated product sitemap through a route on your domain — search engines require sitemaps to be served from the host they cover. Every sitemap helper follows the same contract:
  • 200 with the XML (Content-Type: application/xml; charset=utf-8) on success.
  • 502 with an empty body when the sitemap is unavailable (misconfigured env, unreachable endpoint). A sitemap must be real XML or an error — this is the one place the SDK surfaces failure instead of degrading silently.

Wiring it up

app/sitemap.xml/route.ts
Caches via ISR (revalidate: 3600) by default. Note: this route handler sets only the content type — it does not set a Cache-Control header itself (Next/your CDN controls response caching).

After deploying

  1. Verify https://yourstore.com/sitemap.xml returns 200 with XML.
  2. Submit it in Google Search Console (Indexing → Sitemaps) and reference it from robots.txt:
robots.txt
Getting a 502? See Troubleshooting — it’s almost always a missing environment variable or an unreachable endpoint.