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

@siteproof/sdk

v0.1.0

Published

Core SDK for SiteProof visual editor integration — config, content fetching, editor detection, and PostMessage bridge

Downloads

59

Readme

@siteproof/sdk

Core SDK for SiteProof visual editor integration. Provides configuration, content fetching, editor detection, and the PostMessage bridge for iframe communication.

Installation

npm install @siteproof/sdk @siteproof/react

Quick Start

1. Create a config file

Create siteproof.config.ts in your project root:

import { defineConfig } from '@siteproof/sdk';

export default defineConfig({
  projectId: 'your-project-id',
  editorOrigin: process.env.NEXT_PUBLIC_SITEPROOF_URL ?? 'https://app.siteproof.dev',
});

2. Import the config in your root layout

// app/layout.tsx
import '../siteproof.config';
import { SiteProofProvider } from '@siteproof/react';

export default function RootLayout({ children }) {
  return (
    <html>
      <body>
        <SiteProofProvider>{children}</SiteProofProvider>
      </body>
    </html>
  );
}

3. Wrap editable content

import { Editable } from '@siteproof/react';

export function Hero() {
  return (
    <section>
      <Editable field="home.hero.title" type="text" label="Hero Title">
        <h1>Welcome to our site</h1>
      </Editable>
      <Editable field="home.hero.subtitle" type="text" label="Subtitle">
        <p>The best platform for modern teams.</p>
      </Editable>
    </section>
  );
}

How It Works

  • Production mode: The SDK is completely inert. <SiteProofProvider> and <Editable> render children as-is with zero runtime overhead.
  • Editor mode: When loaded inside SiteProof's visual editor iframe, the SDK activates automatically. It detects the editor environment, completes a PostMessage handshake, registers all <Editable> fields, and enables inline editing.

API Reference

defineConfig(config)

Initialize the SDK with your project settings.

defineConfig({
  projectId: string;       // Your SiteProof project ID
  payloadUrl?: string;     // Payload CMS URL (optional)
  payloadApiKey?: string;  // Payload API key (optional)
  editorOrigin?: string;   // SiteProof editor URL (default: https://app.siteproof.dev)
})

isEditMode()

Returns true when the site is loaded inside SiteProof's visual editor.

Content Fetching

import { getContent, getContentById, getCollectionItems } from '@siteproof/sdk';

// Fetch first document from a collection
const page = await getContent<PageData>('pages');

// Fetch by ID
const post = await getContentById<Post>('posts', 'abc123');

// Fetch collection with filtering and pagination
const posts = await getCollectionItems<Post>('posts', {
  where: { status: { equals: 'published' } },
  limit: 10,
  sort: '-createdAt',
});

PostMessageBridge

Low-level class for iframe communication. Used internally by @siteproof/react.

SiteProofClient

HTTP client for the SiteProof platform API. Used internally.

Requirements

  • Next.js 14+ (App Router or Pages Router)
  • React 18+
  • TypeScript recommended

License

MIT - Phoenix AI Consulting, LLC