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-gemini-nano

v0.1.10

Published

React Native Turbo Module for Gemini Nano on-device AI (Android & iOS)

Readme

react-native-gemini-nano

On-device AI for React Native — powered by Gemini Nano (Android) and Apple Foundation Models (iOS 26+)

npm version npm downloads license platform - android platform - ios


What is this?

react-native-gemini-nano is a Turbo Module (New Architecture) that brings fully on-device generative AI to your React Native app — no API key, no internet connection, no cloud costs.

| Platform | Engine | Minimum | |----------|--------|---------| | Android | Google AI Edge — Gemini Nano (AICore) | Pixel 8 / 8a / 8 Pro or newer only | | iOS | Apple Foundation Models | iOS 26.0+ |

⚠️ Android device requirement: Gemini Nano runs via Google's AICore, which is only available on Pixel 8 series and above. Samsung Galaxy, OnePlus, Xiaomi, and other Android devices are not supported — Samsung uses its own proprietary Galaxy AI (Samsung Gauss) which does not expose a public SDK.

All inference runs locally on the device. Your users' prompts never leave their phone.


Installation

npm install react-native-gemini-nano
# or
yarn add react-native-gemini-nano

Expo

Add the config plugin to your app.json:

{
  "expo": {
    "plugins": ["react-native-gemini-nano"]
  }
}

Then rebuild your dev client:

npx expo prebuild
npx expo run:android
npx expo run:ios

Note: This library requires the New Architecture. It does not work with Expo Go — use a development build.

Bare React Native

iOS

cd ios && pod install

Android

No extra steps. The Google AI Edge SDK is bundled automatically.

Enable New Architecture

// android/gradle.properties
newArchEnabled=true
# ios/Podfile
:new_arch_enabled => true

Usage

Check availability

Always check whether the on-device model is available before generating text.

import { isAvailable, generateText } from 'react-native-gemini-nano';

const supported = await isAvailable();

if (!supported) {
  console.log('Gemini Nano is not available on this device.');
}

Generate text

const response = await generateText('Explain black holes in one sentence.', {
  temperature: 0.7,  // 0.0 = deterministic, 1.0 = creative (default: 0.7)
  maxTokens: 256,    // max output tokens (default: 256)
});

console.log(response);

Full example

import { useState } from 'react';
import { Button, Text, TextInput, View } from 'react-native';
import { isAvailable, generateText } from 'react-native-gemini-nano';

export default function App() {
  const [prompt, setPrompt] = useState('');
  const [result, setResult] = useState('');

  async function run() {
    const ok = await isAvailable();
    if (!ok) return setResult('Not available on this device.');
    const text = await generateText(prompt, { temperature: 0.8 });
    setResult(text);
  }

  return (
    <View>
      <TextInput value={prompt} onChangeText={setPrompt} placeholder="Ask anything..." />
      <Button title="Generate" onPress={run} />
      <Text>{result}</Text>
    </View>
  );
}

API

isAvailable(): Promise<boolean>

Returns true if the on-device model is ready to use on the current device.

| Return | Description | |--------|-------------| | true | Model is available — safe to call generateText | | false | Device not supported or model not downloaded |


generateText(prompt, options?): Promise<string>

Runs inference on-device and returns the generated text.

Parameters

| Parameter | Type | Description | |-----------|------|-------------| | prompt | string | The input text / instruction | | options | GeminiNanoOptions | Optional generation settings |

GeminiNanoOptions

| Option | Type | Default | Description | |--------|------|---------|-------------| | temperature | number | 0.7 | Controls randomness. 0 = focused, 1 = creative | | maxTokens | number | 256 | Maximum number of output tokens |


Platform Notes

Android

  • Requires Google Pixel 8 / 8a / 8 Pro or newer — AICore is a Google-exclusive feature
  • Samsung Galaxy, OnePlus, Xiaomi, and other Android OEMs are not supported
  • Samsung devices use Galaxy AI (Samsung Gauss), which is proprietary and has no public developer SDK
  • Uses com.google.ai.edge.aicore SDK
  • Model is pre-installed by Google Play Services — no download required
  • isAvailable() returns false gracefully on unsupported devices

iOS

  • Requires iOS 26.0 or later
  • Uses Apple's FoundationModels framework (LanguageModelSession)
  • On older iOS, isAvailable() returns false gracefully

New Architecture

This library requires the React Native New Architecture (Turbo Modules + JSI). The legacy bridge is not supported.


Contributing

Contributions are welcome! Please read the development workflow before submitting a PR.


License

MIT © jonadan