@seo-core-app-ai/node-deploy
v1.1.1
Published
Server-side SEO deployment middleware for Node.js — Express, Fastify, Next.js and more
Readme
@seo-core-app-ai/node-deploy
Server-side SEO deployment middleware for Node.js. Apply title tags, meta descriptions, canonical URLs, and on-page SEO changes directly in your server response — before the HTML reaches the browser or crawler.
Part of SEO Core App — the SEO automation platform for technical audits and controlled SEO deployments.
What it does
When you publish an SEO deployment from the SEO Core App dashboard, this package applies it to your Node.js server in real time — no rebuild, no redeployment, no CMS edit required.
- Title tags — override
<title>per URL without touching your codebase - Meta descriptions — update description and Open Graph tags server-side
- Canonical URLs — set or correct canonical links across any page
- Real-time sync — changes propagate within 30 seconds via background polling, or instantly via push webhook
- Crawler-visible — changes are in the HTML before it leaves your server, fully visible to Google and other crawlers without JavaScript execution
Supported frameworks
| Framework | Integration |
|-----------|-------------|
| Next.js (App Router) | SeoDeployHead server component — one line in root layout |
| Express | Middleware — one app.use() call |
| Fastify | Plugin — one app.register() call |
| Generic Node.js | HTTP handler via @seo-core-app-ai/node-deploy/http |
Quick start
1. Install
npm install @seo-core-app-ai/node-deploy2. Set environment variables
Get your Project ID and Deploy Token from Projects → Deploy Script → Node.js in the SEO Core App dashboard.
SEO_DEPLOY_PROJECT_ID=your_project_id
SEO_DEPLOY_TOKEN=your_deploy_token3. Integrate
Next.js (App Router)
Create lib/seo-deploy-client.ts:
import { SeoDeployClient } from "@seo-core-app-ai/node-deploy";
declare global { var _seoDeployClient: SeoDeployClient | undefined; }
if (!global._seoDeployClient) {
global._seoDeployClient = new SeoDeployClient({
projectId: parseInt(process.env.SEO_DEPLOY_PROJECT_ID!),
token: process.env.SEO_DEPLOY_TOKEN!,
});
global._seoDeployClient.initialize().catch(console.error);
}
export const seoDeployClient = global._seoDeployClient;Add one line to middleware.ts to forward the current pathname:
import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";
export function middleware(req: NextRequest) {
const res = NextResponse.next();
res.headers.set("x-seo-core-pathname", req.nextUrl.pathname);
return res;
}
export const config = { matcher: ["/((?!_next|favicon.ico).*)"] };Add SeoDeployHead to your root layout — no per-page changes needed:
// app/layout.tsx
import { SeoDeployHead } from "@seo-core-app-ai/node-deploy/nextjs/head";
import { seoDeployClient } from "@/lib/seo-deploy-client";
export default function RootLayout({ children }) {
return (
<html>
<head>
<SeoDeployHead client={seoDeployClient} />
</head>
<body>{children}</body>
</html>
);
}Express
import express from "express";
import { SeoDeployClient } from "@seo-core-app-ai/node-deploy";
import { createExpressMiddleware } from "@seo-core-app-ai/node-deploy/express";
const client = new SeoDeployClient({
projectId: parseInt(process.env.SEO_DEPLOY_PROJECT_ID!),
token: process.env.SEO_DEPLOY_TOKEN!,
});
await client.initialize();
const app = express();
app.use(createExpressMiddleware(client));Fastify
import Fastify from "fastify";
import { SeoDeployClient } from "@seo-core-app-ai/node-deploy";
import { seoDeployPlugin } from "@seo-core-app-ai/node-deploy/fastify";
const client = new SeoDeployClient({
projectId: parseInt(process.env.SEO_DEPLOY_PROJECT_ID!),
token: process.env.SEO_DEPLOY_TOKEN!,
});
await client.initialize();
const app = Fastify();
await app.register(seoDeployPlugin, { client });Configuration options
new SeoDeployClient({
projectId: 123, // Required. Your project ID.
token: "your_token", // Required. Keep in environment variables.
apiOrigin: "https://...", // Optional. Override API base URL (useful in Docker).
pollIntervalMs: 30_000, // Optional. Background poll interval. Default: 30s.
heartbeatIntervalMs: 60_000, // Optional. Cache freshness check interval. Default: 60s.
webhookPath: "/seo-core/sync", // Optional. Push sync webhook path.
publicUrl: "https://your-site.com",// Optional. Auto-registers push sync webhook on startup.
deploymentTypes: ["title", "description"], // Optional. Limit which element types apply.
onError: (err) => console.error(err), // Optional. Error handler.
});How updates reach your server
The client uses two mechanisms in parallel — no configuration required:
- Polling — fetches the latest deployments every 30 seconds in the background. Works out of the box with no infrastructure requirements.
- Push sync (optional) — the dashboard notifies your server the moment a deployment is saved, delivering changes in under 3 seconds. Requires your server to be publicly reachable via HTTPS.
Either way, changes are applied to the next incoming request after the cache updates — no restart needed.
Links
- SEO Core App — SEO automation platform
- Features — what SEO Core App does
- Pricing — plans and pricing
- Node.js integration docs — full documentation
License
MIT
