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

@carlossts/rtn-utils

v1.0.1

Published

Tools and utilities for React Native with turbo modules.

Readme

rtn-utils

rtn-utils It is a toolkit and utilities library for React Native, built using Turbo Modules. It provides authentication methods and access to global settings, such as location and Bluetooth configuration, for Android devices.

Features

  • Support for fingerprint, PIN, and pattern authentication on Android.
  • Fully compatible with React Native's Turbo Module system.
  • Simple API to integrate local authentication into your React Native application.

Installation

Prerequisites

Ensure your React Native project is properly configured to use Turbo Modules. For more details, follow the official React Native Turbo Modules documentation.

Install the package

npm install @carlossts/rtn-utils
or
yarn add @carlossts/rtn-utils

UI

authenticate method

fingerprintOrPin PIN fingerprintOrPattern pattern

isDeviceSecure method

isDeviceSecure

openGlobalSettings method

openGlobalSettings

getLocationApps method

openAppWithLocation method

API Reference

Methods

authenticate(map: { reason?: string; description?: string }): Promise<string>()

Local device authentication process (using password, PIN, pattern or fingerprint), verifying that the device is protected by some security method, such as a password or biometrics.

Observation: If the device does not have local authentication, return success with the code WITHOUT_AUTHENTICATION.

Options

| Option | Description | | --------------------- | ------------------------------------------------- | | reason | Action title | | description | Action description |

Usage

import React, { useCallback, useEffect } from 'react';
import { Alert, View } from 'react-native';
import { RTNUtils } from '@carlossts/rtn-utils';

const App = () => {
  const authenticationLocal = useCallback(async () => {
    try {
      await RTNUtils.authenticate({
        reason: 'Please authenticate yourself',
        description: 'Enter your password or fingerprint',
      });
    } catch (error) {
      Alert.alert('Authentication Failed', error.message);
    }
  }, []);

  useEffect(() => {
    authenticationLocal();
  }, [authenticationLocal]);

  return <View />;
};

export default App;

ErrorCode

| Code | Description | | --------------------- | ------------------------------------------------- | | E_AUTH_CANCELLED | User canceled the authentication | | E_ONE_REQ_AT_A_TIME | Authentication already in progress | | E_FAILED_TO_SHOW_AUTH | Failed to create authentication intent |

isDeviceSecure(): Promise<boolean>

Checks if the device has some type of authentication.

Usage

import React, { useCallback, useEffect } from 'react';
import { Alert, View } from 'react-native';
import { RTNUtils } from '@carlossts/rtn-utils';

const App = () => {
  const isDeviceSecure = useCallback(async () => {
    try {
     const result = await RTNUtils?.isDeviceSecure();
    Alert.alert('Is it a secure device ?', result ? 'Yes' : 'No');
    } catch (error) {
      Alert.alert('isDeviceSecure Failed', error.message);
    }
  }, []);

  useEffect(() => {
    isDeviceSecure();
  }, [isDeviceSecure]);

  return <View />;
};

export default App;

openGlobalSettings(action: string): Promise<boolean>

Open a global device setting.

Verify Android Settings Reference

Usage

import React, { useCallback, useEffect } from 'react';
import { Alert, View } from 'react-native';
import { RTNUtils } from '@carlossts/rtn-utils';

const App = () => {
  const openGlobalSettings = useCallback(async () => {
    try {
      const result = await RTNUtils?.openGlobalSettings('android.settings.LOCATION_SOURCE_SETTINGS');
      return result;
    } catch (error) {
      const errorMessage = error instanceof Error ? error.message : 'An unknown error occurred';
      Alert.alert('openGlobalSettings Failed', errorMessage);
    }
  }, []);

  useEffect(() => {
    openGlobalSettings();
  }, [openGlobalSettings]);

  return <View />;
};

export default App;

getLocationApps(options: { includesBase64: boolean }): Promise<{ name: string; package: string; icon?: string; }[]>;

Retrieves a list of location-related apps with optional icons in base64 encoding.

Verify example

Options

| Option | Description | | --------------------- | ------------------------------------------------- | | includesBase64 | returns the app's icon in base64 encoding |

Usage

import React, { useCallback, useEffect } from 'react';
import { Alert, View } from 'react-native';
import { RTNUtils } from '@carlossts/rtn-utils';

const App = () => {
   const getLocationApps = useCallback(async () => {
    try {
      const apps = await RTNUtils?.getLocationApps({
        includesBase64: true
      });
      Alert.alert('total applications found:' apps?.length);
    } catch (error) {
      const errorMessage = error instanceof Error ? error.message : 'An unknown error occurred';
      Alert.alert('openGlobalSettings Failed', errorMessage);
    }
  }, []);

  useEffect(() => {
    getLocationApps();
  }, [getLocationApps]);

  return <View />;
};

export default App;

ErrorCode

| Code | Description | | --------------------- | ------------------------------------------------- | | E_INTENT_IS_NULL | Intent is null | | E_GET_ICON_APP | Failed to get icon app |

openAppWithLocation(options: { url: string; packageName: string }): Promise<string>;

Opens a location-related app based on the provided URL and package name.

Verify example

Options

| Option | Description | | --------------------- | ------------------------------------------------- | | url | URL to open the app with parameters | | packageName | App package name |

Usage

import React, { useCallback, useEffect } from 'react';
import { Alert, View } from 'react-native';
import { RTNUtils } from '@carlossts/rtn-utils';

const App = () => {
   const openAppWithLocation = useCallback(async () => {
    try {
      const lat = -4.128489;
      const lng = -38.2593854;
      const label = 'My Location Test';
      const scheme = `geo:0,0?q=${lat},${lng}(${label})`;

      const apps = await RTNUtils?.openAppWithLocation({
        packageName: "com.google.android.apps.maps",
        url: scheme,
      });
      Alert.alert('App opened successfully');
    } catch (error) {
      const errorMessage = error instanceof Error ? error.message : 'An unknown error occurred';
      Alert.alert('openAppWithLocation Failed', errorMessage);
    }
  }, []);

  useEffect(() => {
    openAppWithLocation();
  }, [openAppWithLocation]);

  return <View />;
};

export default App;

ErrorCode

| Code | Description | | --------------------- | ------------------------------------------------- | | E_INTENT_IS_NULL | App does not support the URL scheme | | E_VALIDATION_FAILS | Fields are required | | E_PACKAGE_NOT_FOUND | Package not found |

License

MIT