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

react-native-permit

v0.1.4

Published

React Native permission hooks, modal UI, bottom sheet, screen flows, retry logic, onboarding stepper, and Jest mocks built on react-native-permissions.

Readme

npm version npm downloads license types React Native peer dependency Expo Jest

Small permission orchestration for React Native, built on top of react-native-permissions.

Permission prompts are tiny. Permission flows are not.

Why

Raw permission libraries ask the OS for access. Production apps need the flow around that prompt: rationale UI, retries, blocked-state handling, Settings fallbacks, onboarding sequences, analytics, persistence, and tests.

react-native-permit keeps native permission access in react-native-permissions and adds the app-level permission UX on top.

The OS asks once. Your product has to explain, recover, retry, and remember.

Features

| Feature | API | | --- | --- | | Check/request permissions | Permit.check, Permit.request | | Single permission hook | usePermit | | Multiple permission hook | usePermits | | Status listener | usePermitListener | | Multi-step onboarding | usePermitSequence | | Built-in UI | PermitDialog | | Stepper UI | PermitStepper | | Retry/exhaustion | retry options | | Analytics events | Permit.configure({ onEvent }) | | Jest mocks | react-native-permit/testing |

Less permission plumbing. More feature shipping.

Install

npm install react-native-permit react-native-permissions

For iOS, install pods after adding dependencies:

cd ios && pod install

Configure native permission declarations through react-native-permissions. See Platform setup.

Quick Start

import { Permit } from 'react-native-permit';

const result = await Permit.request('camera');

if (result === 'granted') {
  // Continue with the feature.
}

With retry and persisted exhaustion:

await Permit.request('location', {
  retry: {
    maxAttempts: 3,
    persistExhaustion: true,
    resetExhaustionAfterDays: 30,
  },
});

Hooks

import { Button, Text, View } from 'react-native';
import { usePermit } from 'react-native-permit';

function CameraGate() {
  const camera = usePermit('camera');

  if (camera.status === 'unknown') return <Text>Checking...</Text>;
  if (camera.isGranted) return <Text>Camera is ready.</Text>;

  return (
    <View>
      <Text>Camera status: {camera.status}</Text>
      <Button title="Allow camera" onPress={() => camera.request()} />
      <Button title="Open settings" onPress={camera.openSettings} />
    </View>
  );
}

Permission Decisions

| Result | App action | | --- | --- | | granted | Render the feature | | limited | Continue with limited photo access | | provisional | Continue with quiet notification access | | denied | Retry or degrade gracefully | | blocked | Show a Settings fallback | | exhausted | Stop asking until reset | | unavailable | Hide or disable the feature | | cancelled | Ignore abandoned flow |

Custom Onboarding

Use usePermitSequence for fully custom multi-permission onboarding.

const sequence = usePermitSequence(
  [
    {
      permission: 'camera',
      rationale: {
        title: 'Scan items',
        message: 'Camera access lets you scan QR codes.',
      },
      retry: { maxAttempts: 2 },
    },
    {
      permission: 'notifications',
      optional: true,
      rationale: {
        title: 'Stay updated',
        message: 'Notifications tell you when work is done.',
      },
    },
  ],
  { onComplete: (results) => console.log(results) },
);

Built-In UI

Use PermitDialog when you want small UI primitives without building every permission surface yourself.

<PermitDialog
  presentation="bottom-sheet"
  visible={visible}
  title="Camera access"
  message="Camera access is used to scan QR codes."
  primaryLabel="Allow camera"
  secondaryLabel="Not now"
  onPrimary={() => Permit.request('camera')}
  onSecondary={() => setVisible(false)}
  onDismiss={() => setVisible(false)}
/>;

Supported presentations:

  • bottom-sheet
  • modal
  • screen
  • inline

Bring your own UI, or borrow ours until design has opinions.

Documentation

| Guide | Description | | --- | --- | | Why this package | Comparison diagram, use cases, props, and what you do not have to build | | API reference | Full props, types, return values, and exports | | Recipes | Camera gate, notifications, retry, custom onboarding, built-in UI | | Platform setup | iOS plist and Android manifest examples | | Testing | PermitMock setup and examples | | Examples | Copy-paste examples and product flows |

Supported Permissions

camera, microphone, location, location-coarse, location-always, notifications, photo-library, photo-library-add, contacts, calendar, reminders, bluetooth, motion, face-id, tracking, speech-recognition, body-sensors, activity-recognition, nearby-wifi-devices, media-location.

See API reference for details.

Contributing

Issues, ideas, docs fixes, examples, and pull requests are welcome.

Useful contribution areas:

  • Permission examples for real app flows
  • Platform setup notes for iOS, Android, and Expo
  • Better built-in UI examples
  • Edge cases around blocked, limited, provisional, and exhausted states
  • Testing recipes with react-native-permit/testing

Before opening a PR:

npm run typecheck
npm pack --dry-run

Links

| Link | URL | | --- | --- | | GitHub repo | github.com/prakharcodehere/react-native-permit | | npm package | npmjs.com/package/react-native-permit | | Issues | GitHub issues | | Author profile | github.com/prakharcodehere |

Author

prakharcodehere

License

MIT