Next.js / React
Native integration using the Script component, public directory, and API routes.
1. JSON-LD Structured Data
Use the Next.js Script component in your layout or page:
import Script from "next/script";
export default function Layout({ children }) {
return (
<html>
<body>
{children}
<Script
src="https://cdn.nordax.ai/cdn/entity/{slug}.js"
strategy="afterInteractive"
/>
</body>
</html>
);
}The afterInteractive strategy loads the script after hydration without blocking rendering.
Server-Side Alternative
For full SSR control, fetch the JSON-LD at build or request time and inject it directly:
export default async function Page() {
const res = await fetch(
"https://entities.nordax.ai/{slug}/schema.jsonld",
{ next: { revalidate: 300 } }
);
const jsonLd = await res.json();
return (
<>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{
__html: JSON.stringify(jsonLd),
}}
/>
{/* your page content */}
</>
);
}This bakes the JSON-LD into the server-rendered HTML. The revalidate: 300 re-fetches every 5 minutes.
2. Trust Badge
Create a reusable React component that lazy-loads the badge embed script:
"use client";
import Script from "next/script";
export function NordaxBadge({ slug }: { slug: string }) {
return (
<>
<div id="nordax-badge" data-entity={slug} />
<Script
src="https://cdn.nordax.ai/cdn/badge/embed.js"
strategy="lazyOnload"
/>
</>
);
}Use <NordaxBadge slug="your-slug" /> in your footer or anywhere on the page.
3. llms.txt Hosting
Two approaches:
Option A: Static File
Download llms.txt from the Nordax dashboard and place it in your public/ directory. It will be served at yourdomain.com/llms.txt automatically.Note: this is a static snapshot that won't auto-update.
Option B: Dynamic Route (Recommended)
Create an API route that proxies to the live Nordax endpoint:
export async function GET() {
const res = await fetch(
"https://entities.nordax.ai/{slug}/llms.txt",
{ next: { revalidate: 300 } }
);
const text = await res.text();
return new Response(text, {
headers: {
"Content-Type": "text/plain; charset=utf-8",
"Cache-Control": "public, max-age=300",
},
});
}This serves an always-current llms.txt at your domain root, re-fetching from Nordax every 5 minutes.