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

@userback/react-native-sdk

v1.0.4

Published

Userback feedback widget SDK for React Native

Readme

@userback/react-native-sdk

Userback feedback widget for React Native, powered by a transparent WebView overlay.

Requirements

Both are native modules and must be installed in your app alongside this SDK.

Installation

# npm
npm install @userback/react-native-sdk react-native-webview react-native-view-shot

# yarn
yarn add @userback/react-native-sdk react-native-webview react-native-view-shot

iOS — run pod install after installing:

cd ios && pod install

Android — no extra steps required; native modules are auto-linked via Gradle.

Expo — Expo Go is not supported as this SDK uses native modules. Use a development build:

npx expo install expo-dev-client react-native-webview react-native-view-shot
npx expo run:ios     # or run:android

Setup

Wrap your app's root component with UserbackProvider. It renders a transparent WebView overlay that hosts the widget.

import { UserbackProvider } from '@userback/react-native-sdk';

export default function App() {
  return (
    <UserbackProvider>
      <YourApp />
    </UserbackProvider>
  );
}

Starting the widget

Call UserbackSDK.start() with your access token anywhere in your app. The widget will appear once the WebView is ready.

import { UserbackSDK } from '@userback/react-native-sdk';

UserbackSDK.start({
  accessToken: 'YOUR_ACCESS_TOKEN',
});

Call UserbackSDK.stop() to remove the widget entirely.

UserbackSDK.stop();

Configuration

UserbackSDK.start() accepts a UserbackConfig object:

| Option | Type | Required | Description | |---|---|---|---| | accessToken | string | Yes | Your Userback access token | | userData | UserbackUserData | No | Initial user data passed to the widget | | widgetCSS | string | No | Custom CSS injected into the widget | | surveyURL | string | No | Override the survey endpoint URL | | requestURL | string | No | Override the request endpoint URL | | trackURL | string | No | Override the tracking endpoint URL | | widgetJSURL | string | No | Override the widget JS URL (default: https://static.userback.io/widget/v1.js) |

UserbackUserData shape:

{
  id?: string | number;
  info?: {
    name?: string;
    email?: string;
    [key: string]: string | number | boolean | undefined;
  };
}

API

All methods are on the UserbackSDK singleton.

Widget lifecycle

UserbackSDK.start(config: UserbackConfig): void
UserbackSDK.stop(): void
UserbackSDK.isLoaded(callback: (loaded: boolean) => void): void
UserbackSDK.refresh(refreshFeedback?: boolean, refreshSurvey?: boolean): void
UserbackSDK.destroy(keepInstance?: boolean, keepRecorder?: boolean): void

Opening/closing the widget

UserbackSDK.openForm(mode?: string, directTo?: string): void
UserbackSDK.openPortal(): void
UserbackSDK.openRoadmap(): void
UserbackSDK.openAnnouncement(): void
UserbackSDK.close(): void

User identity

UserbackSDK.identify(userID: string | number, userInfo?: Record<string, any>): void
UserbackSDK.clearIdentity(): void
UserbackSDK.setEmail(email: string): void
UserbackSDK.setName(name: string): void

Customisation

UserbackSDK.setCategories(categories: string): void
UserbackSDK.setPriority(priority: string): void
UserbackSDK.setTheme(theme: string): void
UserbackSDK.setData(data: Record<string, any>): void
UserbackSDK.addHeader(key: string, value: string): void

Session replay

UserbackSDK.startSessionReplay(options?: Record<string, any>): void
UserbackSDK.stopSessionReplay(): void

Custom events

UserbackSDK.addCustomEvent(title: string, details?: Record<string, any>): void

Screenshot capture

Screenshots are captured automatically using react-native-view-shot when a user attaches a screenshot in the feedback form. To use a custom capture implementation instead:

UserbackSDK.screenshotProvider = () => myCustomCapture();

Callbacks

UserbackSDK.onClose = () => { ... };
UserbackSDK.onWidgetConfigLoaded = (config: Record<string, any>) => { ... };
UserbackSDK.onWidgetResize = (size: { width: number; height: number }) => { ... };
UserbackSDK.onLoadError = (payload: Record<string, any>) => { ... };
UserbackSDK.onHcaptchaRequired = (payload: Record<string, any>) => { ... };
UserbackSDK.onOpenURL = (url: string) => { ... };

Example

import React, { useEffect } from 'react';
import { Button, View } from 'react-native';
import { UserbackProvider, UserbackSDK } from '@userback/react-native-sdk';

function FeedbackButton() {
  return (
    <Button
      title="Give Feedback"
      onPress={() => UserbackSDK.openForm()}
    />
  );
}

export default function App() {
  useEffect(() => {
    UserbackSDK.start({ accessToken: 'YOUR_ACCESS_TOKEN' });
    return () => UserbackSDK.stop();
  }, []);

  return (
    <UserbackProvider>
      <View style={{ flex: 1 }}>
        <FeedbackButton />
      </View>
    </UserbackProvider>
  );
}

Running the Example App

git clone https://github.com/userback/widget-react-native
cd widget-react-native
yarn install

iOS

yarn ios

Android

Start an emulator first, then:

yarn android

If the build fails with SDK location not found, create examples/android/local.properties:

sdk.dir=/Users/YOUR_USERNAME/Library/Android/sdk

Replace YOUR_USERNAME with your macOS username, or run echo $HOME to find the path.