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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-lastcrash

v1.0.0

Published

LastCrash SDK for React Native

Readme

React Native LastCrash SDK

A React Native SDK for LastCrash - a comprehensive crash reporting and analytics solution that captures screenshots, monitors app state, and uploads crash reports with visual context.

Features

  • Screenshot Capture: Automatically captures screenshots at regular intervals
  • Crash Reporting: Integrates with native crash reporting (KSCrash on iOS)
  • Network Monitoring: Tracks network requests and responses
  • Event Tracking: Custom event tracking and analytics
  • ANR Detection: Application Not Responding detection
  • Freeze Detection: Detects UI freezes and performance issues
  • Cross-Platform: Works on both iOS and Android

Installation

npm install react-native-lastcrash
# or
yarn add react-native-lastcrash

iOS

After installing, run:

npx pod-install

That’s it! No need to edit your Podfile.

Android

No additional steps required—autolinking will handle everything.


Note: If you are using a monorepo, custom Podfile, or an older version of React Native (<0.60), see the troubleshooting section below.


Usage

Basic Setup

import LastCrash from 'react-native-lastcrash';

// Configure LastCrash with your API key
LastCrash.configure('your-api-key-here');

// Set up crash delegate (optional)
LastCrash.setCrashReportSenderDelegate();

// Mark app as initialized
LastCrash.applicationInitialized();

App.js Example

import React, { useEffect } from 'react';
import { View, Text, Button } from 'react-native';
import LastCrash from 'react-native-lastcrash';

const App = () => {
  useEffect(() => {
    // Configure LastCrash
    LastCrash.configure('your-api-key-here');

    // Set up crash delegate
    LastCrash.setCrashReportSenderDelegate();

    // Mark app as initialized
    LastCrash.applicationInitialized();

    // Enable logging (iOS only)
    LastCrash.enableLogging();

    // Track app open event
    LastCrash.event('app_open');
  }, []);

  const handlePause = () => {
    LastCrash.pause();
    console.log('Video capture paused');
  };

  const handleUnpause = () => {
    LastCrash.unpause();
    console.log('Video capture resumed');
  };

  const handleCustomEvent = () => {
    LastCrash.event('button_clicked', 'test_button');
  };

  const handleCrash = () => {
    // Simulate a crash for testing
    throw new Error('Test crash');
  };

  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <Text>LastCrash Demo</Text>
      <Button title="Pause Capture" onPress={handlePause} />
      <Button title="Resume Capture" onPress={handleUnpause} />
      <Button title="Track Event" onPress={handleCustomEvent} />
      <Button title="Test Crash" onPress={handleCrash} />
    </View>
  );
};

export default App;

API Reference

Methods

configure(apiKey: string)

Configure LastCrash with your API key.

setCrashReportSenderDelegate()

Set up a delegate to handle crash callbacks.

enableLogging() / disableLogging()

Enable or disable LastCrash logging (iOS only).

pause() / unpause()

Pause or resume screenshot capture.

sendCrashes()

Manually send crash reports.

event(name: string, value?: string)

Track a custom event.

applicationInitialized()

Mark the application as initialized.

addNetworkTrackingToDefaultSession()

Add network tracking to the default URL session (iOS only).

addMaskView(viewTag: number)

Mask a specific view.

removeMaskView(viewTag: number)

Remove a mask from a specific view.

removeAllMaskViews()

Remove all view masks.

addMaskRect(x: number, y: number, width: number, height: number, maskId: string)

Mask a specific rectangle.

removeMaskRect(maskId: string)

Remove a specific rectangle mask.

removeAllMaskRects()

Remove all rectangle masks.

Events

LastCrashDidCrash

Emitted when a crash is detected.

import { DeviceEventEmitter } from 'react-native';

DeviceEventEmitter.addListener('LastCrashDidCrash', (reports) => {
  console.log('Crash detected:', reports);
});

Troubleshooting

Monorepos, Custom Podfiles, or Old React Native (<0.60)

  • If your Podfile does not include use_native_modules!, or you are using a monorepo, you may need to manually add the pod to your Podfile:
    pod 'react-native-lastcrash', :path => '../node_modules/react-native-lastcrash'
  • Then run npx pod-install again.
  • For Android, if autolinking does not work, add the project manually to settings.gradle and build.gradle as described in the React Native docs.

Support

For support, please contact [email protected] or visit our documentation at https://docs.lastcrash.io.