Registry / web-framework / rankdeploy-middleware

rankdeploy-middleware

JSON →
library1.3.2jsnpmunverified

SEO middleware that serves pre-rendered HTML to search engine bots while keeping zero performance impact on human visitors. Current stable version is 1.3.2, with regular updates. Key differentiators: seamless integration with Next.js (single-line setup), Netlify Edge Functions, and Express.js; automatically detects a wide range of bots (Google, Bing, Yandex, social media crawlers, AI bots like GPTBot and Claude); supports custom API URL, extra bots, and exclusion paths. Built by Rank Deploy, it offers a simple, efficient alternative to more complex prerendering solutions.

npm install rankdeploy-middleware
INSTALL
IMPORT
SIG · RANKDEPLOY-MIDDLEW
R
rankdeploy-middleware
web-frameworkjavascriptv1.3.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

middleware, config (Next.js)
export { middleware, config } from '@rankdeploy/middleware/next'
import { middleware } from '@rankdeploy/middleware'
Must use named export and export { } pattern; import and default export won't work in middleware.ts.
default (Netlify)
export { default } from '@rankdeploy/middleware/netlify'
export default from '@rankdeploy/middleware/netlify'
Must use named re-export of default; shorthand export default from syntax is invalid.
rankdeploy (Express)
import { rankdeploy } from '@rankdeploy/middleware/express'
import rankdeploy from '@rankdeploy/middleware/express'
Express export is a named function, not a default export.

One-line integrations for Next.js, Netlify Edge Functions, and Express.js.

// Next.js / Vercel // File: middleware.ts (at project root) export { middleware, config } from '@rankdeploy/middleware/next' // Netlify // File: netlify/edge-functions/rankdeploy.ts export { default } from '@rankdeploy/middleware/netlify' // Express.js // File: server.ts import express from 'express' import { rankdeploy } from '@rankdeploy/middleware/express' const app = express() app.use(rankdeploy()) app.listen(3000)
Debug
Known issues
gotchaIn Next.js, the middleware file must be named middleware.ts (not .js) and located at the project root (not /pages or /app). Also, the export must be a named export of both middleware and config; using a default export will break the integration.
fix
Ensure file is middleware.ts at root and export { middleware, config } from '@rankdeploy/middleware/next'.
affects: >=1.0
gotchaNetlify Edge Functions require a netlify.toml configuration with the function name matching the file name. If the file is named other than rankdeploy.ts, the export and config must be adjusted accordingly.
fix
Name the file rankdeploy.ts and add [[edge_functions]] function = "rankdeploy" path = "/*" to netlify.toml.
affects: >=1.0
gotchaThe Express middleware should be applied before other routes, especially those that handle static files or API endpoints. Applying it after other middleware may cause it to be bypassed for prerender requests.
fix
Place app.use(rankdeploy()) as early as possible, before express.static and route handlers.
affects: >=1.0
deprecatedThe default API URL (https://proxy.unikium.com) may be deprecated in future versions; check documentation for updated endpoint.
fix
Consider using createMiddleware to specify a custom apiUrl or watch for changelog updates.
affects: >=1.0
Errors
Common errors & fixes
Cannot find module '@rankdeploy/middleware' or its corresponding type declarations.
The module is installed but TypeScript cannot resolve its types.
fix
Ensure your tsconfig.json includes 'node_modules/@types' or install @types/node. Also verify the package is in dependencies (not devDependencies) if you need types in production.
Expected ';' at 'middleware' (import error in middleware.ts)
The Next.js middleware file is imported incorrectly or named export syntax is wrong.
fix
Use export { middleware, config } from '@rankdeploy/middleware/next'. Do not use import or default export.
Netlify Edge Function import failed: '@rankdeploy/middleware/netlify' is not a valid function handler.
The Netlify edge function file does not export the default handler properly.
fix
Ensure the file exports default: export { default } from '@rankdeploy/middleware/netlify'. The file name must match the function name in netlify.toml.
TypeError: rankdeploy is not a function
Trying to use Express import as a default import instead of named import.
fix
Use import { rankdeploy } from '@rankdeploy/middleware/express'. Then call rankdeploy() (note parentheses).
Upgrade
Version history
1.3.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
rankdeploy-middleware — npm install rankdeploy-middleware · libregistry