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

@kleroai/react

v0.2.0

Published

Official Klero React SDK — feedback boards, roadmaps, changelogs, surveys & widgets

Downloads

174

Readme

@kleroai/react

Official React SDK for Klero — embed feedback boards, roadmaps, changelogs, surveys, and widgets in your React app.

Installation

npm install @kleroai/react

Quick Start

Components can be used with or without <KleroProvider>.

With KleroProvider (shared config)

import { KleroProvider, KleroFeedback, KleroWidget } from '@kleroai/react';

function App() {
  return (
    <KleroProvider projectSlug="your-project">
      <KleroFeedback />
      <KleroWidget />
    </KleroProvider>
  );
}

Without KleroProvider (standalone)

import { KleroFeedback, KleroWidget } from '@kleroai/react';

function App() {
  return (
    <>
      <KleroFeedback projectSlug="your-project" />
      <KleroWidget projectSlug="your-project" />
    </>
  );
}

Components

<KleroProvider>

Optional wrapper that provides shared configuration to all child Klero components.

| Prop | Type | Required | Description | |------|------|----------|-------------| | projectSlug | string | Yes | Your Klero project slug | | baseUrl | string | No | Custom base URL (defaults to https://{slug}.klero.ai) | | customerToken | string | No | JWT for authenticated users | | loginUrl | string | No | Redirect URL for unauthenticated users |

Shared config props

All components accept the same optional config props, which override any values from a parent <KleroProvider>:

| Prop | Type | Description | |------|------|-------------| | projectSlug | string | Your Klero project slug | | baseUrl | string | Custom base URL | | customerToken | string | JWT for authenticated users | | loginUrl | string | Redirect URL for unauthenticated users |

<KleroFeedback />

Renders an inline feedback board. Accepts config props and standard <div> props for styling.

<KleroRoadmap />

Renders an inline roadmap. Accepts config props, standard <div> props, and an optional roadmapSlug to show a specific roadmap.

| Prop | Type | Description | |------|------|-------------| | roadmapSlug | string | Specific roadmap to display |

<KleroChangelog />

Renders an inline changelog. Accepts config props and standard <div> props for styling.

<KleroWidget />

Renders a floating widget button (appended to document.body). Accepts config props.

<KleroSurvey />

Displays a survey modal. Accepts config props plus:

| Prop | Type | Required | Description | |------|------|----------|-------------| | surveyUlid | string | Yes | Survey ULID | | onComplete | (data: KleroSurveyCompletedEvent) => void | No | Fired on submission | | onClose | (data: KleroSurveyClosedEvent) => void | No | Fired on close | | onError | (data: KleroSurveyErrorEvent) => void | No | Fired on error |

Hooks

useKleroSurvey()

Programmatically open/close a survey.

const { open, close } = useKleroSurvey();
open('survey-ulid');

useKleroWidget()

Programmatically open/close the widget.

const { open, close } = useKleroWidget();
open();

useKleroEvents(callbacks)

Listen to Klero postMessage events.

useKleroEvents({
  'klero:survey:completed': (data) => console.log(data),
  'klero:survey:closed': (data) => console.log(data),
  'klero:widget:opened': () => console.log('Widget opened'),
});

useKleroScript(baseUrl)

Low-level hook that loads the Klero script and returns { loaded, error }. Useful for advanced use cases where you need to know when the script is ready.

const { loaded, error } = useKleroScript('https://your-project.klero.ai');

TypeScript

The following types are exported:

import type {
  KleroConfig,
  KleroSurveyCompletedEvent,
  KleroSurveyClosedEvent,
  KleroSurveyErrorEvent,
  KleroEventMap,
  KleroEventType,
} from '@kleroai/react';

SSR Support

All components are SSR-safe (Next.js, Remix, etc). DOM access only occurs in useEffect.

License

MIT