npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

simplesitepass-next

v0.1.0

Published

No-FOUC client-side app or page password protection via SimpleSitePass.com (Next.js/React).

Readme

SimpleSitePass React/NextJS Component

Protect any page or your entire site with a simple authentication layer — ideal for Framer, Next.js, and other React-based sites.
This component wraps your content and only renders it if the visitor has been authenticated via SimpleSitePass.

Perfect for:

  • Private pages (e.g., portfolio works, beta landing pages, documentation sites and so on)
  • Internal tools
  • Gated content previews

🚀 Features

  • Quick setup – add one wrapper component to protect any React/NextJS page
  • Auth + Token verification handled via SimpleSitePass
  • No backend setup needed — works with your existing SimpleSitePass account
  • Custom loading UI while verification happens
  • Cookie-based session (default 2 hours)
  • Works in Next.js, Framer, Create React App, etc.

📦 Installation

npm install simplesitepass-react

🔑 How It Works

  1. You create a Site ID in your SimpleSitePass dashboard.
  2. You wrap your page (or the entire app) in the <SimpleSitePass> component, passing your siteId.
  3. On load, the component:
    • Checks for a valid token in the URL or cookies
    • If missing or invalid → redirects user to your SimpleSitePass auth page
    • If valid → renders your content
  4. Tokens expire after 2 hours by default (configurable).

📖 Usage

"use client";
import SimpleSitePass from "simplesitepass-react";

export default function ProtectedPage() {
  return (
    <SimpleSitePass
      siteId="YOUR_SITE_ID"
      loadingComponent={<p>Checking access...</p>}
      onAuthorized={() => console.log("User authorized!")}
    >
      <h1>Welcome to the private area</h1>
      <p>This content is protected by SimpleSitePass.</p>
    </SimpleSitePass>
  );
}

⚙️ Props

| Prop | Type | Default | Description | |--------------------|-------------------|-----------------------------------------------------------------------------------------------|-------------| | siteId | string | Required | Your SimpleSitePass Site ID (found in your dashboard) | | loadingComponent | React.ReactNode | <p style="text-align:center;padding:24px;">Loading...</p> | What to display while verifying auth | | cookieMaxAge | number | 7200 (2 hours) | How long the access token is valid (in seconds) | | onAuthorized | () => void | undefined | Callback fired after user is successfully authorized | | children | React.ReactNode | Required | The protected content to render once authorized |


🔍 Example: Protecting an Entire Next.js App

In app/layout.tsx:

"use client";
import SimpleSitePass from "simplesitepass-react";

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>
        <SimpleSitePass siteId="YOUR_SITE_ID" loadingComponent={<div>Loading...</div>}>
          {children}
        </SimpleSitePass>
      </body>
    </html>
  );
}

This ensures all pages are gated.


🔐 Security Notes

  • The component hides your content until the token is validated.
  • If JavaScript is disabled, the content will be visible — this is intentional for SEO compatibility. If you need complete blocking even with JS disabled, use a server-side auth method.
  • Tokens are stored in cookies scoped to your domain.

🌐 Learn More

For more details, visit SimpleSitePass.com.