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

@sjforge/feedback-widget-native

v0.1.0

Published

React Native feedback widget SDK with screenshots and context capture

Readme

@sjforge/feedback-widget-native

React Native SDK for the SJForge Feedback Portal. Enables in-app feedback collection with screenshots, automatic context capture, and offline support.

Installation

npm install @sjforge/feedback-widget-native

# Required peer dependencies
npx expo install @react-native-async-storage/async-storage @react-native-community/netinfo

# Optional - for screenshot support
npx expo install react-native-view-shot

# Optional - for enhanced device info
npx expo install expo-device

Quick Start

import { FeedbackWidget, FeedbackButton, FeedbackForm } from '@sjforge/feedback-widget-native';
import { useState } from 'react';
import { View } from 'react-native';

// Initialize once (e.g., in App.tsx before rendering)
FeedbackWidget.init({
  projectId: 'my-app',
  apiKey: 'fpk_xxx', // Get from feedback portal admin
});

function App() {
  const [showForm, setShowForm] = useState(false);

  return (
    <View style={{ flex: 1 }}>
      {/* Your app content */}
      <YourAppContent />

      {/* Floating feedback button */}
      <FeedbackButton onPress={() => setShowForm(true)} />

      {/* Feedback form modal */}
      <FeedbackForm
        visible={showForm}
        onClose={() => setShowForm(false)}
      />
    </View>
  );
}

Configuration

FeedbackWidget.init({
  // Required
  projectId: 'my-app',
  apiKey: 'fpk_xxx',

  // Optional
  apiUrl: 'https://feedback.sjforge.dev/api/widget', // Custom API URL
  user: {
    name: 'John Doe',
    email: '[email protected]',
  },
  customContext: {
    appVersion: '1.2.3',
    userId: 'user-123',
  },

  // Callbacks
  onSubmitStart: () => console.log('Submitting...'),
  onSubmitSuccess: (feedbackId) => console.log('Submitted:', feedbackId),
  onSubmitError: (error) => console.error('Failed:', error),
});

Components

FeedbackButton

Floating button to trigger the feedback form.

<FeedbackButton
  position="bottom-right" // 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
  primaryColor="#007AFF"
  text="Feedback"
  visible={true}
  onPress={() => setShowForm(true)}
/>

FeedbackForm

Modal form for submitting feedback.

<FeedbackForm
  visible={showForm}
  onClose={() => setShowForm(false)}
  screenshotUri={screenshotUri} // Optional pre-captured screenshot
  primaryColor="#007AFF"
  title="Submit Feedback"
  descriptionPlaceholder="Describe your feedback..."
/>

Programmatic Submission

const response = await FeedbackWidget.submit({
  type: 'bug', // 'bug' | 'feature' | 'design'
  priority: 'high', // 'low' | 'medium' | 'high' | 'critical'
  title: 'App crashes on launch',
  description: 'The app crashes when I open it',
  screenshotUri: 'file://...', // Optional
});

if (response.success) {
  console.log('Feedback ID:', response.feedback_id);
} else {
  console.error('Error:', response.error);
}

Offline Support

Feedback is automatically queued when offline and synced when connectivity returns.

// Check online status
const isOnline = FeedbackWidget.isOnline();

// Get pending count
const pending = await FeedbackWidget.getPendingCount();

// Force sync
const { succeeded, failed } = await FeedbackWidget.syncOffline();

Context

The widget automatically captures:

  • Device info (brand, model, type)
  • OS info (name, version)
  • Screen info (width, height, scale)
  • Locale and timezone
  • Custom context you provide
// Add custom context at any time
FeedbackWidget.setContext({
  currentScreen: 'HomeScreen',
  userId: 'user-123',
});

// Get current context (for debugging)
const context = await FeedbackWidget.getContext();

Screenshots

If react-native-view-shot is installed, you can capture screenshots:

import { captureScreenshot, isScreenshotSupported } from '@sjforge/feedback-widget-native';

if (isScreenshotSupported()) {
  const result = await captureScreenshot(viewRef);
  if (result) {
    setScreenshotUri(result.uri);
  }
}

Cleanup

// When your app unmounts
FeedbackWidget.destroy();

Compatibility

  • React Native >= 0.70.0
  • Expo SDK >= 47
  • iOS 13+
  • Android API 21+

License

MIT