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

@seriphxyz/astro

v0.1.11

Published

Astro components and content loader for Seriph widgets (forms, comments, reactions, posts)

Downloads

615

Readme

@seriphxyz/astro

Note: This repo is a read-only mirror. Source lives in a private monorepo. For issues/PRs, please open them here and we'll sync changes back.

Astro components and content loader for Seriph - widgets for static sites.

Installation

npm install @seriphxyz/astro

Setup

Add your Seriph site key to your .env:

SERIPH_SITE_KEY=your_site_key_here

Content Loader (Posts)

Fetch posts from Seriph at build time using Astro's content collections:

// src/content.config.ts
import { defineCollection } from "astro:content";
import { seriphPostsLoader } from "@seriphxyz/astro/loader";

const posts = defineCollection({
  loader: seriphPostsLoader({
    siteKey: import.meta.env.SERIPH_SITE_KEY,
  }),
});

export const collections = { posts };

Then use in your pages:

---
import { getCollection } from "astro:content";
const posts = await getCollection("posts");
---

{posts.map((post) => (
  <article>
    <h2>{post.data.title}</h2>
    <p>{post.data.excerpt}</p>
  </article>
))}

Loader Options

seriphPostsLoader({
  siteKey: string;        // Required - your Seriph site key
  endpoint?: string;      // Default: 'https://seriph.xyz'
  tag?: string;           // Filter posts by tag
  limit?: number;         // Max posts to fetch (default: 500)
  onError?: 'throw' | 'warn' | 'ignore';  // Error handling
})

Components

Form

A wrapper component for contact forms with built-in spam protection:

---
import Form from "@seriphxyz/astro/Form";
---

<Form siteKey={import.meta.env.SERIPH_SITE_KEY} formSlug="contact">
  <input name="name" placeholder="Name" required />
  <input name="email" type="email" placeholder="Email" required />
  <textarea name="message" placeholder="Message" required></textarea>
  <button type="submit">Send</button>
</Form>

Props:

  • siteKey (required) - Your Seriph site key
  • formSlug (required) - The form slug as configured in Seriph
  • endpoint - Base URL (default: https://seriph.xyz)
  • theme - 'light' | 'dark' | 'auto' (default: 'light')
  • class - Additional CSS class

Events:

  • seriph:loading - Form submission started
  • seriph:success - Submission successful (detail contains response)
  • seriph:error - Submission failed (detail contains error)

Comments

Threaded comments with a submission form:

---
import Comments from "@seriphxyz/astro/Comments";
---

<Comments
  siteKey={import.meta.env.SERIPH_SITE_KEY}
  pageId={Astro.url.pathname}
/>

Props:

  • siteKey (required) - Your Seriph site key
  • pageId (required) - Unique page identifier (e.g., URL path)
  • endpoint - Base URL (default: https://seriph.xyz)
  • theme - 'light' | 'dark' | 'auto' (default: 'light')
  • class - Additional CSS class

Events:

  • seriph:comment-posted - Comment submitted (detail contains comment)

Reactions

Reaction buttons (like, love, clap, etc.):

---
import Reactions from "@seriphxyz/astro/Reactions";
---

<Reactions
  siteKey={import.meta.env.SERIPH_SITE_KEY}
  pageId={Astro.url.pathname}
  reactions={["like", "love", "clap"]}
/>

Props:

  • siteKey (required) - Your Seriph site key
  • pageId (required) - Unique page identifier
  • reactions - Array of reaction types (default: ['like'])
  • icons - Custom icons: { like: '👍', love: '❤️' }
  • endpoint - Base URL (default: https://seriph.xyz)
  • theme - 'light' | 'dark' | 'auto' (default: 'light')
  • class - Additional CSS class

Built-in icons: like, love, clap, fire, think, sad, laugh

Events:

  • seriph:reaction-added - Reaction added
  • seriph:reaction-removed - Reaction removed

Subscribe

Email subscription form with double opt-in:

---
import Subscribe from "@seriphxyz/astro/Subscribe";
---

<Subscribe
  siteKey={import.meta.env.SERIPH_SITE_KEY}
  buttonText="Subscribe"
  placeholder="[email protected]"
/>

Props:

  • siteKey (required) - Your Seriph site key
  • endpoint - Base URL (default: https://seriph.xyz)
  • buttonText - Submit button text (default: 'Subscribe')
  • placeholder - Email input placeholder
  • successMessage - Custom success message
  • theme - 'light' | 'dark' | 'auto' (default: 'light')
  • class - Additional CSS class

Events:

  • seriph:subscribed - Subscription successful

SubscribeForm

A more flexible subscription form that wraps your own markup:

---
import SubscribeForm from "@seriphxyz/astro/SubscribeForm";
---

<SubscribeForm siteKey={import.meta.env.SERIPH_SITE_KEY}>
  <input name="email" type="email" placeholder="Email" required />
  <button type="submit">Join newsletter</button>
</SubscribeForm>

JavaScript API

For advanced use cases, use the JavaScript API directly:

import {
  submitForm,
  fetchComments,
  postComment,
  fetchReactions,
  addReaction,
  fetchPosts,
  fetchPost,
} from "@seriphxyz/astro";

// Submit a form
await submitForm({
  siteKey: "your_key",
  formSlug: "contact",
  data: { name: "John", email: "[email protected]", message: "Hello!" },
});

// Fetch comments
const comments = await fetchComments({
  siteKey: "your_key",
  pageId: "/blog/my-post",
});

// Add a reaction
await addReaction({
  siteKey: "your_key",
  pageId: "/blog/my-post",
  reactionType: "like",
});

Styling

Components use CSS custom properties for theming. Override them to match your site:

.seriph-comments {
  --seriph-border-color: #e5e7eb;
  --seriph-bg-color: #f9fafb;
  --seriph-text-color: inherit;
  --seriph-button-bg: #3b82f6;
  /* ... see component source for all variables */
}

License

MIT