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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@autoschema/sdk

v0.1.2

Published

AutoSchema SDK for React and Next.js

Readme

@autoschema/sdk

AutoSchema SDK for React and Next.js projects.

Install

npm i @autoschema/sdk

React-only projects can use this package without Next.js. The next peer dependency is optional and only needed when you import @autoschema/sdk/next.

Environment variables (recommended naming)

Use env vars for API keys instead of hard-coding them in source control.

Next.js (App Router / next)

Create .env.local in the project root (do not commit secrets):

NEXT_PUBLIC_AUTOSCHEMA_KEY=sk_...
NEXT_PUBLIC_AUTOSCHEMA_MODE=cdn_hybrid
# Optional — defaults match production AutoSchema if omitted:
# NEXT_PUBLIC_AUTOSCHEMA_API_BASE=https://www.autoschema.app
# NEXT_PUBLIC_AUTOSCHEMA_STATIC_BASE=https://cdn.autoschema.app/schemas

NEXT_PUBLIC_AUTOSCHEMA_MODE is optional; if unset, pass mode explicitly in code. Valid values align with the SDK: cdn_hybrid, cdn_static_only, api_dynamic.

Vite / React SPA

Vite exposes only variables prefixed with VITE_:

VITE_AUTOSCHEMA_KEY=sk_...
VITE_AUTOSCHEMA_MODE=cdn_hybrid
# Optional:
# VITE_AUTOSCHEMA_API_BASE=https://www.autoschema.app
# VITE_AUTOSCHEMA_STATIC_BASE=https://cdn.autoschema.app/schemas

Create React App (react-scripts)

Use the REACT_APP_ prefix:

REACT_APP_AUTOSCHEMA_KEY=sk_...
REACT_APP_AUTOSCHEMA_MODE=cdn_hybrid

Quick Start (React)

import { AutoSchemaProvider, AutoSchemaHead } from "@autoschema/sdk/react";

export function App() {
  return (
    <AutoSchemaProvider
      apiKey={import.meta.env.VITE_AUTOSCHEMA_KEY!}
      apiBase="https://www.autoschema.app"
      staticBase="https://cdn.autoschema.app/schemas"
      mode={(import.meta.env.VITE_AUTOSCHEMA_MODE as "cdn_hybrid") ?? "cdn_hybrid"}
    >
      <AutoSchemaHead />
      {/* app */}
    </AutoSchemaProvider>
  );
}

(With CRA, use process.env.REACT_APP_AUTOSCHEMA_KEY instead of import.meta.env.)

Quick Start (Next.js App Router)

import { AutoSchemaScript } from "@autoschema/sdk/next";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html>
      <head>
        <AutoSchemaScript
          apiKey={process.env.NEXT_PUBLIC_AUTOSCHEMA_KEY!}
          mode={
            (process.env.NEXT_PUBLIC_AUTOSCHEMA_MODE as
              | "cdn_hybrid"
              | "cdn_static_only"
              | "api_dynamic") ?? "cdn_hybrid"
          }
        />
      </head>
      <body>{children}</body>
    </html>
  );
}

Server helper for Next.js

import { getAutoSchemaForNext } from "@autoschema/sdk/next";

const schema = await getAutoSchemaForNext({
  apiKey: process.env.AUTOSCHEMA_KEY!,
  url: "/about",
  mode: "cdn_hybrid",
});

Modes

  • cdn_hybrid: static CDN -> edge static -> dynamic API (fallbacks only on cache/static miss).
  • cdn_static_only: static CDN only (no API fallback).
  • api_dynamic: direct /api/schema.

Publish (maintainers)

From this package directory (not the monorepo root):

cd packages/autoschema-sdk
npm version patch   # or: manually set "version" in package.json
npm run build
npm publish --access public

prepublishOnly runs npm run build automatically before publish.