How To: Custom application-layer SSR with the Export Data API

Modified on Tue, 17 Nov at 5:13 PM

Use this article when your team wants server-side JSON-LD in the HTML response but prefers not to deploy Schema App’s Akamai EdgeWorker or Cloudflare Worker. Instead, your application (origin, CMS, middleware, or platform edge function) fetches cached markup from Schema App and injects it into <head>.

Note: Schema App provides the data API and CDN. Building and maintaining the injection code in your application is owned by your engineering team. For turnkey edge packages, see the Akamai and Cloudflare setup guides.

What you need

  1. Cached markup on Schema App’s CDN (data.schemaapp.com) for each URL you will inject.
  2. Server-side (or middleware) codethat, for each HTML page response:
    • Normalizes the page URL to origin + pathname (strip query string and fragment).
    • Base64-encodes that URL and removes trailing = characters.
    • GETs the Individual Export Data API URL for your account and page.
    • Injects one or more <script type="application/ld+json"> tags into <head>.
  3. Correct data-source attributes on those script tags (required for Schema App monitoring and to avoid duplicate client-side injection).

Common injection points include CMS/application response middleware, reverse proxies, platform edge functions (for example Azure Front Door Rules / Edge Actions, Netlify Edge Functions, or Next.js middleware), and commerce platforms such as SFCC ISML/SFRA hooks that can rewrite HTML before it reaches the browser.

Populate the CDN first

The Export Data API only returns markup that already exists in cache. Choose one generation path:

  • Recommended for SSR: Enable Crawler deployment on Highlighter templates so Schema App’s crawler populates the CDN. Production pages do not need highlight.js once injection works.
  • Alternative: Use JavaScript + Cache (or JS+Webhooks) so highlight.js generates markup and writes it to the CDN, then your server reads it back. Do not run full client-side rendering and custom SSR together in production.

Editor / Crawler / Merchant Center markup is stored under https://data.schemaapp.com/{AccountId}/{base64Url}. Highlighter cache markup is under https://data.schemaapp.com/{AccountId}/__highlighter_js/{base64Url}. Fetch both paths when your project uses both sources (same pattern as Schema App’s edge workers).

Injection requirements

  • Map the CDN response header x-amz-source (fallback: x-amz-meta-source) to the script tag’s data-source attribute.
  • Fail open: if the CDN returns empty or errors, return the original HTML unchanged.
  • Respect cache headers; do not flood the CDN with uncached parallel downloads of your whole site (use Bulk Export for warehouse-style pulls).
  • After custom SSR is validated, remove client-side highlight.js from production pages to avoid duplicate markup.

API reference

Full URL construction, headers, compression, and a code example: Export Data API - Individual.

Limits and concurrency expectations: Export Data API - Individual: rate limits, quotas, and concurrency

How this differs from Akamai / Cloudflare SSR

TopicSchema App edge workersCustom app-layer SSR
Who builds injectionSchema App package + your CDN configYour application team
Where it runsCDN edge (Akamai / Cloudflare)Your origin, CMS, middleware, commerce platform (e.g. SFCC), Azure Front Door / reverse proxy, or platform edge function
Markup sourceSame: cached JSON-LD on data.schemaapp.com
Support modelDocumented CDN setup + troubleshootingAPI guidance; limited support for custom code

Related articles

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article