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

@konvo-ai/sdk-rn

v1.0.0

Published

KonvoAI Conversational Ad SDK for React Native - Intelligent contextual advertising with AI-powered decision engine for mobile apps

Downloads

4

Readme

KonvoAI React Native SDK

Intelligent contextual advertising with AI-powered decision engine for React Native mobile apps

Installation

npm install @konvo-ai/sdk-rn

Note: This SDK requires @react-native-async-storage/async-storage for storing anonymous user IDs. It will be installed automatically as a dependency.

For React Native projects, you may need to run:

cd ios && pod install  # iOS only

Quick Start

import { KonvoAIAds } from '@konvo-ai/sdk-rn';
import { View, Text, TouchableOpacity, StyleSheet } from 'react-native';

// Initialize the SDK
KonvoAIAds.init({
  apiKey: 'your-api-key-here'
});

const AdComponent = () => {
  const [adData, setAdData] = useState(null);

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

  const loadAd = async () => {
    try {
      const response = await KonvoAIAds.decide({
        context: {
          domain: 'gaming',
          content: 'mobile-game-tutorial',
          placement: 'banner'
        },
        user: {
          userId: 'user123',
          anonId: await KonvoAIAds.generateAnonId()
        },
        chat: {
          lastUserMsg: 'This game is awesome!'
        }
      });

      if (response.fill && response.render) {
        setAdData(response);
        // Track impression
        await KonvoAIAds.handleImpression(response);
      }
    } catch (error) {
      console.error('Failed to load ad:', error);
    }
  };

  if (!adData) return null;

  return (
    <View style={styles.adContainer}>
      <Text style={styles.title}>{adData.render.title}</Text>
      <Text style={styles.description}>{adData.render.description}</Text>
      <TouchableOpacity 
        style={styles.ctaButton}
        onPress={adData.render.cta.handler}
      >
        <Text style={styles.ctaText}>{adData.render.cta.label}</Text>
      </TouchableOpacity>
    </View>
  );
};

const styles = StyleSheet.create({
  adContainer: {
    padding: 16,
    borderWidth: 1,
    borderColor: '#ddd',
    borderRadius: 8,
    backgroundColor: '#f9f9f9',
  },
  title: {
    fontSize: 18,
    fontWeight: 'bold',
    marginBottom: 8,
  },
  description: {
    fontSize: 14,
    color: '#666',
    marginBottom: 12,
  },
  ctaButton: {
    backgroundColor: '#007AFF',
    paddingVertical: 8,
    paddingHorizontal: 16,
    borderRadius: 4,
  },
  ctaText: {
    color: 'white',
    textAlign: 'center',
    fontWeight: '600',
  },
});

API Reference

KonvoAIAds.init(config)

Initialize the SDK with your API configuration.

Parameters:

  • config.apiKey (string, required): Your KonvoAI API key
  • config.baseUrl (string, optional): Custom API base URL (defaults to production)

KonvoAIAds.decide(input)

Request an ad decision from the KonvoAI engine.

Parameters:

  • input.context (object): Context information about the placement
    • domain (string): Content domain/category
    • content (string): Content identifier
    • placement (string): Ad placement identifier
  • input.user (object): User information
    • userId (string, optional): Authenticated user ID
    • anonId (string): Anonymous user identifier
  • input.chat (object): Chat context
    • lastUserMsg (string): Most recent user message for context

Returns: Promise

  • decisionId (string): Unique decision identifier
  • fill (boolean): Whether an ad should be shown
  • render (object, optional): Ad content when fill is true
    • title (string): Ad headline
    • description (string): Ad description
    • cta (object): Call-to-action
      • label (string): Button text
      • handler (function): Click handler function

KonvoAIAds.handleImpression(response)

Track an ad impression. Call this when the ad is displayed to the user.

Parameters:

  • response (DecideResponse): The response from decide()

KonvoAIAds.generateAnonId()

Generate or retrieve a persistent anonymous user ID stored in AsyncStorage.

Returns: Promise - Anonymous user identifier

Privacy & Data Handling

The KonvoAI SDK includes automatic PII scrubbing for user messages:

  • Names are replaced with [NAME]
  • Phone numbers are replaced with [PHONE]
  • Email addresses are replaced with [EMAIL]
  • Social Security Numbers are replaced with [SSN]
  • Credit card numbers are replaced with [CARD]
  • ZIP codes are replaced with [ZIP]

React Native Compatibility

  • Supports React Native 0.60.0 and above
  • Compatible with both iOS and Android
  • Uses AsyncStorage for persistent anonymous ID storage
  • Handles deep linking through React Native's Linking API

Support

  • Documentation: https://docs.konvo.ai/react-native-sdk
  • Issues: https://github.com/konvo-ai/sdk-rn/issues
  • Email: [email protected]

License

MIT License - see LICENSE file for details.