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

secrethero-react-native

v1.6.0

Published

SecretHero ReactNative SDK

Downloads

29

Readme

Secret Hero Setup

Description

Secret Hero is a sdk designed to add gaming functionalities into your application. This SDK empowers developers to integrate engaging gameplay experiences, including leaderboard tracking and coupon rewards, enhancing user engagement and retention within your app.

Installation

To integrate the SecretHero library into your project, add the following dependency as follows;

With React Native:

npm install secrethero-react-native

Architecture Support

This library supports both React Native's Old Architecture (Paper + Bridge) and New Architecture (Fabric + TurboModules) with automatic detection and backward compatibility.

  • Old Architecture: Works with React Native < 0.68;
    • Android; in example/android/gradle.properties set newArchEnabled=false and gradle sync
    • iOS; run pod update as export RCT_NEW_ARCH_ENABLED=0 && pod install
  • New Architecture: Works with React Native >= 0.68;
    • Android; in example/android/gradle.properties set newArchEnabled=false and gradle sync
    • iOS; run pod update as export RCT_NEW_ARCH_ENABLED=1 && pod install

Setup

Initialize Secret Hero

  1. The initialize function within the SecretHero SDK is responsible for initializing the SDK with specific configuration settings and an listener to handle events and callbacks.

  2. The SecretHeroConfig class is responsible for the configuration initializing the SecretHero SDK.

import SecretHero from 'secrethero-react-native';

SecretHero.initialize(secretHeroConfig, secretHeroListener);
let secretHeroConfig: SecretHeroConfig = {
    token: "your_token",
    userId: "user_id",
    country: "country",
    language: "language",
    iconImage: iconImage,
    isLayoutLTR: isLayoutLTR,
    displayName: "display_name",
    theme: {
        primaryColor: "#191D21",
        secondaryColor: "#FFFFFF",
        highlightColor: "#7B61FF",
        buttonColor: "#92FFD7",
    }
};
  • token: A token required for authentication and interaction with the SecretHero SDK.

  • userId: Represents the user ID associated with the SecretHero session.

  • displayName: An display name for the user within the SecretHero environment.

  • language: An optional string indicating the preferred language setting.

  • country: An optional string indicating the preferred country setting.

  • iconImage: An optional String representing the file path name of application image.

  • isLayoutLTR: An optional boolean value indicating the layout direction.

  • primaryColor: An integer value representing the primary color used in the sdk's interface or visual elements (text color).

  • secondaryColor: An integer value representing the primary color used in the sdk's interface or visual elements (background color).

  • highlightColor : An integer value representing the color used to highlight specific elements or actions within the sdk's interface

  • buttonColor : An integer value specifying the color utilized for buttons or interactive elements within the sdk's interface

  1. The SecretHeroEventListener serves as a callback mechanism within the SecretHero SDK, providing methods to handle various events and responses during the SDK's lifecycle and operations.
let secretHeroListener: SecretHeroListener = {
    onInitialized: () {
        console.log(`onInitialized`);
    },
    onInitializeFailed: (errorMessage) {
        console.log(`onInitializeFailed $errorMessage`);
    }, 
    onOpen: () {
        console.log(`onOpen`);
    }, 
    onClose: () {
        console.log(`onClose`);
    }, 
    onEvent: (event, extras) {
        console.log(`onEvent $event`);
    }
};
  • onInitialized(): Invoked when the SecretHero SDK is successfully initialized.
  • onInitializeFailed(errorMessage: String) : Triggered upon initialization failure in the SecretHero SDK
  • onClose() : Called when the SecretHero session is closed or terminated
  • onOpen() : Executed when the SecretHero session is opened or activated
  • onEvent() : The onEvent function is a callback that handles specific game events and their associated data. Event (String) represents the type of event that occurred. It can have one of the following values: "GAME_SUCCESS", "GAME_FAILED", "GAME_CLICKED", "COUPON_COPIED", "GAME_STARTED". Extras Map<string, string | null> a map containing additional details about the event. Possible keys include: "gameName", "gameDuration", "gameCoupon"
  1. The release() function within the SecretHero serves the purpose of releasing and resetting configuration and listeners associated with the SecretHero. Need to be called onDestroy