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

@upbinger/blog-react

v1.1.5

Published

React component for embedding Upbinger blog content with visit analytics

Downloads

677

Readme

@upbinger/blog-react

React component for embedding Upbinger blog content into your React application.

Installation

npm install @upbinger/blog-react react-router-dom
# or
yarn add @upbinger/blog-react react-router-dom

Quick Start

import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { UpbingerBlog } from '@upbinger/blog-react';

function App() {
  return (
    <BrowserRouter>
      <Routes>
        {/* Your other routes */}
        <Route path="/" element={<Home />} />
        
        {/* Blog routes - handles /blog, /blog/:slug, /blog/page-:page */}
        <Route path="/blog/*" element={<UpbingerBlog />} />
      </Routes>
    </BrowserRouter>
  );
}

Configuration

<UpbingerBlog
  // CDN base URL (default: https://cdn.upbinger.com)
  cdnBase="https://cdn.upbinger.com"
  
  // Base path for blog routes (default: /blog)
  basePath="/blog"
  
  // Enable debug logging
  debug={true}
  
  // Custom loading component
  loadingComponent={<MySpinner />}
  
  // Custom error component
  errorComponent={<MyError />}
  
  // Override domain (defaults to window.location.hostname)
  domain="example.com"
  
  // Additional CSS class
  className="my-blog-container"
/>

Using the Hook

For custom implementations, use the useBlogContent hook:

import { useBlogContent } from '@upbinger/blog-react';

function CustomBlogPost({ slug }) {
  const { loading, error, content, styles } = useBlogContent(slug);

  if (loading) return <div>Loading...</div>;
  if (error) return <div>Error: {error}</div>;

  return (
    <>
      <style dangerouslySetInnerHTML={{ __html: styles }} />
      <div dangerouslySetInnerHTML={{ __html: content }} />
    </>
  );
}

// For listing pages, pass a page number
function CustomBlogListing({ page }) {
  const { loading, content } = useBlogContent(page); // page = 1, 2, 3...
  // ...
}

Adding Header and Footer

Wrap the UpbingerBlog component in a layout component to add your own header and footer:

import { UpbingerBlog } from '@upbinger/blog-react';

// Create a layout wrapper component
function BlogLayout() {
  return (
    <div className="blog-page">
      {/* Your Header */}
      <header className="bg-white shadow-sm">
        <nav className="max-w-6xl mx-auto px-4 py-4 flex items-center justify-between">
          <a href="/" className="text-xl font-bold">My Site</a>
          <div className="flex gap-6">
            <a href="/">Home</a>
            <a href="/blog">Blog</a>
            <a href="/about">About</a>
            <a href="/contact">Contact</a>
          </div>
        </nav>
      </header>

      {/* Blog Content */}
      <main className="max-w-6xl mx-auto px-4 py-8">
        <UpbingerBlog />
      </main>

      {/* Your Footer */}
      <footer className="bg-gray-900 text-white py-12">
        <div className="max-w-6xl mx-auto px-4">
          <div className="grid grid-cols-1 md:grid-cols-3 gap-8">
            <div>
              <h3 className="font-bold mb-4">My Site</h3>
              <p className="text-gray-400">Your site description here.</p>
            </div>
            <div>
              <h3 className="font-bold mb-4">Links</h3>
              <ul className="space-y-2 text-gray-400">
                <li><a href="/privacy">Privacy Policy</a></li>
                <li><a href="/terms">Terms of Service</a></li>
              </ul>
            </div>
            <div>
              <h3 className="font-bold mb-4">Contact</h3>
              <p className="text-gray-400">[email protected]</p>
            </div>
          </div>
          <p className="text-center text-gray-500 mt-8">
            © 2026 My Site. All rights reserved.
          </p>
        </div>
      </footer>
    </div>
  );
}

// Use in your routes
function App() {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="/blog/*" element={<BlogLayout />} />
      </Routes>
    </BrowserRouter>
  );
}

How It Works

  1. The component fetches pre-built HTML from Upbinger's CDN
  2. Content is loaded based on your domain (e.g., cdn.upbinger.com/blogs/yourdomain.com/)
  3. Internal links are intercepted for SPA navigation
  4. Styles from the blog are injected into the page

Routes Created

| Path | Description | |------|-------------| | /blog | Blog listing (page 1) | | /blog/page-2 | Blog listing (page 2, etc.) | | /blog/my-post-slug | Individual blog post |

Requirements

  • React 17+ (hooks support)
  • react-router-dom 6+
  • Blogs published through Upbinger dashboard

License

MIT