Socket
Book a DemoInstallSign in
Socket

snapcrawl-express-ssr

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snapcrawl-express-ssr

Express middleware that serves pre-rendered HTML from SnapCrawl's SSR API to improve SEO for JavaScript apps.

1.0.2
latest
npmnpm
Version published
Weekly downloads
255
Maintainers
1
Weekly downloads
 
Created
Source

SnapCrawl Express Middleware

This middleware intercepts requests from known bots (Googlebot, ChatGPT, Bing, etc.) and serves pre-rendered HTML content from SnapCrawl's SSR API. This ensures optimal SEO for JavaScript-heavy applications like React, Vue, Angular SPAs.

Features

  • Detects popular bots via User-Agent
  • Detects desktop vs mobile crawlers
  • Skips rendering for static assets (like .js, .png, .css, etc.)
  • Fetches HTML from SnapCrawl API and serves to the bot

Free Credits, Billing & Your API Secret

🔑 Get your API secret

  • Create an account (or sign in): snapcrawl.io
  • Go to your DashboardSecret keys
  • Copy your Secret Key

Installation

npm install snapcrawl-express

Usage

import express from "express";
import snapcrawlMiddleware from "snapcrawl-express";

const app = express();

app.use(
  snapcrawlMiddleware({
    secret: "your-snapcrawl-api-secret",
  })
);

app.listen(3000);

How It Works

  • Middleware checks the User-Agent header to identify if it's a bot.
  • Skips requests for static assets like .js, .jpg, etc.
  • If it's a bot requesting an HTML route, it sends a request to SnapCrawl's SSR API.
  • The API returns the pre-rendered HTML and serves it directly to the bot.

List of Known Bots

A sample of detected bots includes:

  • Googlebot
  • Bingbot
  • GPTBot
  • FacebookExternalHit
  • TwitterBot
  • ChatGPT-User
  • DiscordBot
  • and many more...

Options

OptionTypeRequiredDescription
secretStringYour SnapCrawl API secret key.

Keywords

snapcrawl

FAQs

Package last updated on 25 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.