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

@contentpass/react-native-contentpass-ui

v0.1.1

Published

Contentpass React Native UI Components

Readme

@contentpass/react-native-contentpass-ui

Pre-built UI components for integrating the Contentpass consent layer into React Native apps. Renders the Contentpass first-layer consent dialog in a WebView and manages its visibility based on the user's authentication and consent state.

Installation

npm install @contentpass/react-native-contentpass-ui
# or
yarn add @contentpass/react-native-contentpass-ui

Peer dependencies

Make sure the following peer dependencies are installed in your project:

  • @contentpass/react-native-contentpass
  • react
  • react-native
  • react-native-webview

You also need a CMP adapter (e.g. @contentpass/react-native-contentpass-cmp-onetrust) that implements the CmpAdapter interface.

Components

ContentpassConsentGate

A gate component that wraps your app content. It automatically shows the Contentpass consent layer when the user has neither authenticated with Contentpass nor given full CMP consent. Once consent is granted or the user authenticates, the layer is dismissed and the children are displayed.

Props

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | children | ReactNode | Yes | — | The app content to render when consent is given or the user is authenticated. | | cmpAdapter | CmpAdapter | Yes | — | A CMP adapter instance (e.g. from @contentpass/react-native-contentpass-cmp-onetrust). | | contentpassConfig | ContentpassConfig | Yes | — | The Contentpass SDK configuration object. | | hideAppWhenVisible | boolean | No | true | When true, the app content is completely replaced by the consent layer. When false, the consent layer is rendered as an overlay on top of the app content. | | onVisibilityChange | (visible: boolean) => void | No | — | Callback invoked when the consent layer visibility changes. |

Usage

Wrap your app with ContentpassSdkProvider (from @contentpass/react-native-contentpass) and place ContentpassConsentGate around the content that should be gated:

import { ContentpassSdkProvider } from '@contentpass/react-native-contentpass';
import { ContentpassConsentGate } from '@contentpass/react-native-contentpass-ui';
import type { CmpAdapter } from '@contentpass/react-native-contentpass';

function App() {
  // Initialize your CMP and create an adapter first
  const cmpAdapter: CmpAdapter = /* ... */;
  const contentpassConfig = /* your ContentpassConfig */;

  return (
    <ContentpassSdkProvider contentpassConfig={contentpassConfig}>
      <ContentpassConsentGate
        cmpAdapter={cmpAdapter}
        contentpassConfig={contentpassConfig}
        hideAppWhenVisible={false}
      >
        {/* Your app content */}
      </ContentpassConsentGate>
    </ContentpassSdkProvider>
  );
}

For a full working example using OneTrust as the CMP, see the examples/onetrust directory.

How it works

  1. ContentpassConsentGate waits for both the CMP adapter and the Contentpass SDK to be ready.
  2. It evaluates whether the user needs to see the consent layer: the layer is shown when the user is neither authenticated with Contentpass nor has given full consent via the CMP.
  3. The consent layer itself is a hosted web page rendered in a WebView (ContentpassLayer). It communicates back to the native app via postMessage to trigger actions like "accept all", "show CMP details", or "login/signup with Contentpass".
  4. When the user takes an action (e.g. accepts all cookies or logs in), the gate re-evaluates and hides the layer when appropriate.

Requirements

  • React Native >= 0.76.0
  • @contentpass/react-native-contentpass (peer dependency)
  • react-native-webview (peer dependency)

License

MIT