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

@contentful/optimization-web-preview-panel

v0.1.0-alpha11

Published

<p align="center"> <a href="https://www.contentful.com/developers/docs/personalization/"> <img alt="Contentful Logo" title="Contentful" src="https://raw.githubusercontent.com/contentful/optimization/v0.1.0-alpha11/contentful-icon.png" width="150">

Downloads

221

Readme

Guides · Reference · Contributing

[!WARNING]

The Optimization SDK Suite is pre-release (alpha). Breaking changes may be published at any time.

This library implements a "preview panel" compatible with the Contentful Optimization Web SDK. The preview panel is loaded into the DOM as a Web Component-based micro-frontend.

[!INFO]

The Contentful Optimization Web Preview Panel is built using the Lit framework for Web Component micro-frontends

Getting Started

Install using an NPM-compatible package manager, pnpm for example:

pnpm install @contentful/optimization-web-preview-panel

Import the preview-panel attach function; both CJS and ESM module systems are supported, ESM preferred:

import attachOptimizationPreviewPanel from '@contentful/optimization-web-preview-panel'

Initialize the preview panel with existing instances of the Contentful SDK and the Optimization Web SDK:

attachOptimizationPreviewPanel({ contentful: contentfulClient, optimization, nonce: undefined })

The attachOptimizationPreviewPanel function automatically attaches itself to the DOM and adds the toggle button with which the panel can be opened.

[!IMPORTANT]

The preview panel is intentionally tightly coupled to the Optimization Web SDK internals. It uses the symbol-keyed preview bridge provided by optimization.registerPreviewPanel(...) and state interceptors to read and mutate internal state for local preview overrides. This coupling is deliberate and required for preview behavior parity.

Content Security Policy Support

In order to comply with strict CSP policies, a nonce can be supplied to the attachOptimizationPreviewPanel function as its third argument.

attachOptimizationPreviewPanel({ contentful: contentfulClient, optimization, nonce })

Alternatively, the nonce can be added to the window before attaching the preview panel to the DOM.

window.litNonce = nonce
attachOptimizationPreviewPanel({ contentful: contentfulClient, optimization, nonce: undefined })