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-native

v0.1.0

Published

React Native SDK for Klero surveys and feedback widgets

Readme

@kleroai/react-native

React Native SDK for displaying Klero surveys and feedback widgets in your mobile app.

Installation

npm install @kleroai/react-native react-native-webview
# or
yarn add @kleroai/react-native react-native-webview

iOS Setup

cd ios && pod install

Android Setup

No additional setup required.

Usage

Embed Any Module

Use KleroEmbed or convenience components to display any Klero module:

import {
  KleroEmbed,
  KleroFeedback,
  KleroRoadmap,
  KleroChangelog,
  KleroWidget,
} from '@kleroai/react-native';

// Generic component
<KleroEmbed projectSlug="myproject" embedType="feedback" />

// Convenience components
<KleroFeedback projectSlug="myproject" />
<KleroRoadmap projectSlug="myproject" />
<KleroChangelog projectSlug="myproject" />
<KleroWidget
  projectSlug="myproject"
  onWidgetOpened={() => console.log('opened')}
  onWidgetClosed={() => console.log('closed')}
/>

With programmatic control:

import { useRef } from 'react';
import { KleroFeedback, KleroEmbedHandle } from '@kleroai/react-native';

const ref = useRef<KleroEmbedHandle>(null);
<KleroFeedback ref={ref} projectSlug="myproject" />

// Reload
ref.current?.reload();

Basic Survey

import { KleroSurvey } from '@kleroai/react-native';

function App() {
  return (
    <KleroSurvey
      projectSlug="myproject"
      surveyUlid="01ABC123..."
      onComplete={(data) => {
        console.log('Survey completed:', data.responseUlid);
        console.log('Answers:', data.answers);
      }}
      onClose={(data) => {
        console.log('Survey closed, completed:', data.completed);
      }}
      onError={(error) => {
        console.error('Survey error:', error);
      }}
    />
  );
}

With Ref for Programmatic Control

import { useRef } from 'react';
import { Button, View } from 'react-native';
import { KleroSurvey, KleroSurveyHandle } from '@kleroai/react-native';

function App() {
  const surveyRef = useRef<KleroSurveyHandle>(null);

  const openSurvey = () => {
    surveyRef.current?.open();
  };

  const closeSurvey = () => {
    surveyRef.current?.close();
  };

  return (
    <View style={{ flex: 1 }}>
      <Button title="Open Survey" onPress={openSurvey} />
      <Button title="Close Survey" onPress={closeSurvey} />

      <KleroSurvey
        ref={surveyRef}
        projectSlug="myproject"
        surveyUlid="01ABC123..."
        onComplete={(data) => {
          console.log('Survey completed!');
        }}
      />
    </View>
  );
}

With Customer Token

import { KleroSurvey } from '@kleroai/react-native';

function App() {
  return (
    <KleroSurvey
      projectSlug="myproject"
      surveyUlid="01ABC123..."
      customerToken="user-token-123"
      onComplete={(data) => {
        // Response is linked to the customer
      }}
    />
  );
}

Custom Base URL

For self-hosted or custom domain setups:

import { KleroSurvey } from '@kleroai/react-native';

function App() {
  return (
    <KleroSurvey
      projectSlug="myproject"
      baseUrl="https://feedback.mycompany.com"
      surveyUlid="01ABC123..."
    />
  );
}

API Reference

KleroEmbed Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | projectSlug | string | Yes | Your Klero project slug | | embedType | KleroEmbedType | Yes | Module type (feedback, roadmap, changelog, widget, survey) | | baseUrl | string | No | Custom base URL | | customerToken | string | No | Token to identify the customer | | embedConfig | Record<string, unknown> | No | Additional config for the embed | | style | ViewStyle | No | Custom container styles | | onWidgetOpened | () => void | No | Widget panel opened | | onWidgetClosed | () => void | No | Widget panel closed | | onLoad | () => void | No | WebView finished loading |

KleroEmbedHandle Methods

| Method | Description | |--------|-------------| | reload() | Reload the embed |

Convenience Components

| Component | Equivalent | |-----------|------------| | KleroFeedback | <KleroEmbed embedType="feedback" /> | | KleroRoadmap | <KleroEmbed embedType="roadmap" /> | | KleroChangelog | <KleroEmbed embedType="changelog" /> | | KleroWidget | <KleroEmbed embedType="widget" /> |

KleroSurvey Props

| Prop | Type | Required | Description | |------|------|----------|-------------| | projectSlug | string | Yes | Your Klero project slug | | surveyUlid | string | Yes | The survey's unique identifier | | baseUrl | string | No | Custom base URL (default: https://{projectSlug}.klero.ai) | | customerToken | string | No | Token to identify the customer | | style | ViewStyle | No | Custom styles for the container | | onComplete | (data: SurveyCompletedEvent) => void | No | Called when survey is submitted | | onClose | (data: SurveyClosedEvent) => void | No | Called when survey is closed | | onError | (error: string) => void | No | Called when survey fails to load | | onLoad | () => void | No | Called when WebView finishes loading |

KleroSurveyHandle Methods

| Method | Description | |--------|-------------| | open(surveyUlid?: string) | Open the survey (optionally with a different ULID) | | close() | Close the survey |

Event Types

SurveyCompletedEvent

interface SurveyCompletedEvent {
  surveyUlid: string;
  responseUlid: string;
  answers: Record<string, unknown>;
}

SurveyClosedEvent

interface SurveyClosedEvent {
  surveyUlid: string;
  completed: boolean;
}

useKleroEvents Hook

For more granular event handling:

import { useEffect } from 'react';
import { useKleroEvents } from '@kleroai/react-native';

function App() {
  const { on } = useKleroEvents();

  useEffect(() => {
    const unsubscribe = on('survey:completed', (data) => {
      console.log('Survey completed:', data.responseUlid);
    });

    return unsubscribe;
  }, [on]);

  // ...
}

Requirements

  • React Native >= 0.60.0
  • react-native-webview >= 11.0.0

License

MIT