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

@userjot/next

v1.0.0-beta.1

Published

UserJot client for Next applications

Readme

Installation

Using npm

npm install @userjot/next

Using yarn

yarn add @userjot/next

Using pnpm

pnpm add @userjot/next

Configuration (UserJot Dashboard)

Before using automatic login features, ensure you've configured your UserJot project. To learn more about how to do this, please refer to the UserJot documentation.

Usage (Setting up the Provider)

The @userjot/next package provides a UserJotProvider to initialize the UserJot SDK within your Next.js application.

App Directory:

In the app directory, import UserJotProvider and include it in the <head> of your root layout component:

import { UserJotProvider } from "@userjot/next";

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="en">
      <head>
        <UserJotProvider projectId="<YOUR_PROJECT_ID>" />
        {/* Other head elements */}
      </head>
      <body>
        {/* Your layout */}
        <main>{children}</main>
      </body>
    </html>
  );
}

Replace <YOUR_PROJECT_ID> with your actual UserJot Project ID, which can be found on the Settings > SSO page in your UserJot dashboard.

Pages Directory:

In the pages directory, wrap your custom _app.js (or _app.tsx) component with the UserJotProvider:

import { UserJotProvider } from "@userjot/next";
import type { AppProps } from "next/app";

export default function App({ Component, pageProps }: AppProps) {
  return (
    <UserJotProvider projectId="<YOUR_PROJECT_ID>">
      {/* Your app content */}
      <Component {...pageProps} />
    </UserJotProvider>
  );
}

Replace <YOUR_PROJECT_ID> with your actual UserJot Project ID.

Identifying Users (Hooks)

To identify users and associate them with their actions, use the useUserJot hook.

import { useUserJot } from "@userjot/next";

export function MyComponent() {
  const { identify } = useUserJot();

  useEffect(() => {
    identify({
      id: "USER_UNIQUE_ID", // Required: Unique identifier for the user in your system
      email: "[email protected]", // Required: User's email address
      firstName: "John", // Optional: User's first name
      lastName: "Doe", // Optional: User's last name
      avatar: "URL_TO_USER_AVATAR", // Optional: URL to the user's profile picture
      // signature: "GENERATED_HMAC_SIGNATURE" // Required if "Require signed tokens" is on (see below)
    });
  }, []);

  // ...
}

Secure Authentication with Signatures

If you enabled the Require signed tokens option in your UserJot settings (recommended), you must include a signature field in the identify call.

The signature is an HMAC SHA256 hash of the user's unique ID (the id field), created using your Secret Key. To learn more about how to generate a signature, please refer to the UserJot documentation.

Here is how the identify call looks with the signature:

import { useUserJot } from "@userjot/next";

export function MySecureComponent({
  userSignature,
}: {
  userSignature: string;
}) {
  const { identify } = useUserJot();

  useEffect(() => {
    identify({
      id: "USER_UNIQUE_ID",
      email: "[email protected]",
      firstName: "John",
      lastName: "Doe",
      avatar: "URL_TO_USER_AVATAR",
      signature: userSignature, // The server-generated signature
    });
  }, []);

  // ...
}