/**
* Client-side helper for IndexNow pings via the internal proxy.
* Guarantees fire-and-forget: errors are caught silently so user flows are never blocked.
*/
export const pingIndexNow = (urls: string | string[]): void => {
const list = Array.isArray(urls) ? urls : [urls];
if (typeof window === "undefined" || list.length === 0) return;
void fetch("/_internal/indexnow", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ urls: list })
}).catch(() => {
// silent fire-and-forget
});
};