Socket
Book a DemoInstallSign in
Socket

@opacity-labs/react-native-opacity

Package Overview
Dependencies
Maintainers
2
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opacity-labs/react-native-opacity

Opacity Networks library for React Native

6.2.0
Source
npmnpm
Version published
Weekly downloads
315
8.25%
Maintainers
2
Weekly downloads
 
Created
Source

react-native-opacity

Opacity Networks library for React Native. Only new architecture is supported.

Install

yarn add @opacity-labs/react-native-opacity

Expo

You can automatically configure your app via CNG, add to app.json:

{
  ...
  "plugins": [
    ...,
    "@opacity-labs/react-native-opacity"
  ]
}

Bare React Native App

iOS

Do a pod install after installing the library

Android

First add the necessary repos to download the dependencies. On your root android/build.gradle add:

allprojects {
  repositories {
    google()
    mavenCentral()
    // If you already have allprojects->respositories just make sure you have these two added
    maven { url "https://maven.mozilla.org/maven2/" }
    maven { url 'https://jitpack.io' }
  }
}

On your apps AndroidManifest.xml add an activity:

      // Put this on the same level as other activities
      <activity
        android:name="com.opacitylabs.opacitycore.InAppBrowserActivity"
        android:theme="@style/Theme.AppCompat.DayNight"
      />

Codegen config

Independently of Expo or a bare React Native app. You need to make sure react-native.config.js is properly set up for code generation to work:

module.exports = {
  project: {
    android: {
      packageName: 'your.package.name', // must match your android apps package name
    },
  },
};

API

Once everything is setup you can call the init method on your JS:

// Create an OpacityInstance.ts file
import {
  init,
  get,
  OpacityEnvironment,
} from '@opacity-labs/react-native-opacity';

try {
  init('Your API key', false, OpacityEnvironment.PRODUCTION);
} catch (e) {
  console.error(`Could not start opacity SDK: ${e}`);
}

export async function getUberRiderProfile() {
  let { response, error } = await get('flow:uber_rider:profile');
  if (error) {
    // handle the error returned by the library
    console.log(error.code, error.message);
  } else {
    console.log(response);
  }
}

Keywords

react-native

FAQs

Package last updated on 28 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.