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

nbase-ad-react-native-sdk

v1.0.2

Published

React Native SDK for AdStage

Readme

NBase AdStage React Native SDK

React Native SDK for NBase AdStage - Deep link and promotion management solution.

Installation

npm install nbase-ad-react-native-sdk
# or
yarn add nbase-ad-react-native-sdk

Platform Setup

iOS Setup

  1. Install iOS dependencies:
cd ios && pod install
  1. Add to your ios/Podfile:
pod 'AdapterAdStage', '3.0.2'

Android Setup

  1. Add to your android/build.gradle (project level):
allprojects {
    repositories {
        // ... other repositories
        maven { url "https://repo.nbase.io/repository/nbase-releases" }
    }
}
  1. The SDK automatically includes the required dependencies.

Usage

Basic Setup

import AdStageSDK from 'nbase-ad-react-native-sdk';

// Initialize the SDK using AdStageSDK unified class
await AdStageSDK.setApiKey('YOUR_API_KEY');

// Optional: Set server URL
await AdStageSDK.setServerUrl('https://beta-api.adstage.app');

Deep Link Handling

// Setup unified deep link listener (uses AdStageSDK.setUnifiedListener internally)
AdStageSDK.setUnifiedListener((event) => {
  console.log('Deep link received:', event.deepLink);
  console.log('Payload:', event.payload);
});

// Or use the automatic setup with options
AdStageSDK.setupDeepLinkHandling((event) => {
  console.log('Deep link received:', event.deepLink);
  console.log('Payload:', event.payload);
}, {
  autoCheckPending: true,    // Check for pending deep links on app start
  autoHandleAppState: true,  // Handle app foreground events
  showAlert: false          // Show alert when deep link received
});

Create Deep Links

// Using the unified AdStageSDK approach
const deepLinkConfig = {
  name: 'My Campaign',
  description: 'Campaign description',
  shortPath: 'promo2024',
  channel: 'social',
  campaign: 'summer_sale',
  parameters: {
    product_id: '123',
    discount: '20'
  }
};

// Create deep link using AdStageSDK
const shortUrl = await AdStageSDK.createDeepLink().create(deepLinkConfig);
console.log('Generated URL:', shortUrl);

Promotion Management

// Get promotion list using AdStageSDK.PromotionParams
const promotionParams = {
  bannerType: 'POPUP',              // NATIVE, INTERSTITIAL, REWARDED_VIDEO, POPUP
  targetAudience: 'new_users',      // Custom target audience
  deviceType: 'HIGH_END',           // LOW_END, MID_END, HIGH_END
  region: 'KR',                     // KR, JP, US, SEA, EU, GLOBAL
  limit: 10,                        // Number of promotions to fetch
  status: 'ACTIVE',                 // ACTIVE, PENDING, PAUSED, ENDED
  partner: 'partner_name',          // Partner/advertiser filter
  primaryInterest: 'GAMES',         // GAMES, SHOPPING, ENTERTAINMENT, etc.
  primaryAgeGroup: '18-24',         // 13-17, 18-24, 25-34, 35-44, 45+
  gameGenrePreference: 'RPG',       // RPG, STRATEGY, CASUAL, ACTION, PUZZLE
  playerSpendingTier: 'WHALE',      // F2P, DOLPHIN, WHALE
  playTimePattern: 'EVENING'        // MORNING, AFTERNOON, EVENING, NIGHT
};

// Get promotion list using AdStageSDK
const promotions = await AdStageSDK.getPromotionList(promotionParams);
console.log('Promotions:', promotions);

// Open promotion dialog using AdStageSDK
await AdStageSDK.openPromotion(promotionParams, true); // showTodayButton

Event Tracking

// Track custom events
await AdStageSDK.trackEvent('user_action', {
  deeplinkId: 'abc123',
  action_type: 'click',
  value: 100
});

User Management

// Set user ID
await AdStageSDK.setUserId('user_12345');

// Get user ID
const userId = await AdStageSDK.getUserId();

// Set custom attributes
await AdStageSDK.setCustomAttribute('user_level', '5');

// Get all attributes
const attributes = await AdStageSDK.getAllCustomAttributes();

API Reference

Methods

  • initialize(apiKey: string): Promise<void>
  • setupDeepLinkHandling(callback, options?): void
  • createDeepLink(config: DeepLinkConfig): Promise<string>
  • getPromotionList(params: PromotionParams): Promise<PromotionListResult>
  • openPromotion(params: PromotionParams, showTodayButton?: boolean): Promise<string>
  • trackEvent(eventName: string, params?: EventParams): Promise<void>
  • setUserId(userId: string): Promise<void>
  • getUserId(): Promise<string>
  • setCustomAttribute(key: string, value: string): Promise<void>
  • getAllCustomAttributes(): Promise<Record<string, string>>

Interfaces

interface DeepLinkConfig {
  name: string;
  description?: string;
  shortPath?: string;
  channel?: string;
  campaign?: string;
  parameters?: Record<string, string>;
}

interface PromotionParams {
  promotionId?: string;
  bannerType?: string;
  targetAudience?: string;
  limit?: number;
  status?: string;
  showTodayButton?: boolean;
}

Requirements

  • React Native >= 0.60
  • iOS >= 15.0
  • Android API Level >= 24

License

MIT

Support

For support, please visit NBase.io