
Product
A Fresh Look for the Socket Dashboard
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
@getcello/cello-react-native
Advanced tools
React Native wrapper to bridge our iOS and Android SDK
npm install @getcello/cello-react-native
or
yarn add @getcello/cello-react-native
If you're using React Native v0.60 or above, the library will be linked automatically without any steps being taken.
react-native link @getcello/cello-react-native
android/settings.gradle
include ':cello-react-native'
project(':cello-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/@getcello/cello-react-native/android')
android/app/build.gradle
, inside dependencies
at very bottom addimplementation project(':cello-react-native')
android/app/src/main/java/com/YOUR_APP/app/MainApplication.java
inside onCreate
method, replacing productId
and token
which can be found in your settings page.import com.celloreactnative.CelloReactNativeModule; // <-- Add this line
// ...
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
// ...
CelloReactNativeModule.initialize("productId", "token"); // <-- Add this line
// ...
}
android/build.gradle
and change minSdkVersion
to 21, compileSdkVersion
to at least 34 and targetSdkVersion
to at least 34buildscript {
// ...
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 21 // <-- Here
compileSdkVersion = 34 // <-- Here
targetSdkVersion = 34 // <-- Here
}
// ...
}
android/build.gradle
make sure that com.android.tools.build:gradle
version is greater than 8.1.1
dependencies {
classpath("com.android.tools.build:gradle:8.1.1")
// ...
}
You will need to include the INTERNET permission in android/app/src/main/AndroidManifest.xml
:
<uses-permission android:name="android.permission.INTERNET" />
Cello for iOS requires a minimum iOS version of 15.
cd ios
pod install
cd ..
If you're using React Native v0.60 or above, the library will be linked automatically without any steps being taken.
See How to manually link IOS Cello SDK
Open ios/AppDelegate.m
then add below code:
At the top of file add the following:
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
// ...
#import <CelloReactNative.h> // <-- Add This
didFinishLaunchingWithOptions
before return YES
add, remember to replace productId
and token
which can be found in your Cello Portal: // ...
self.window.rootViewController = rootViewController;
[CelloReactNative initialize:for@"productId" with:@"token"]; // <-- Add this (Remember to replace strings with your product id and token)
return YES;
}
If you are using Expo, you can use the built-in plugin.
After installing this package, add the config plugin to the plugins
array of your app.json
or app.config.js
:
{
"expo": {
"plugins": ["@getcello/cello-react-native"]
}
}
The plugin provides props to set environment. Every time you change the props or plugins, you'll need to rebuild (and prebuild
) the native app. If no extra properties are added, defaults will be used.
env
(string): Set to your desired environment, such as prod
, sandbox
. Optional. Defaults to prod
.{
"expo": {
"plugins": [
[
"@getcello/cello-react-native",
{
"env": "sandbox"
}
]
]
}
}
Next, rebuild your app as described in the "Adding custom native code" guide.
import Cello from '@getcello/cello-react-native';
Cello.initialize(productId, token)
Initializes the Cello Referral Component in your product
Type | Type | Required |
---|---|---|
productId | string | yes |
token | string | yes |
Promise<configuration>
Cello.showFab()
Shows the Floating action button or bookmark that launches the Referral Component
Cello.hideFab()
Hides the Floating action button or bookmark that launches the Referral Component
Cello.openWidget()
Opens Referral Component
Cello.hideWidget()
Closes Referral Component
Cello.shutdown()
Closes Referral Component
Cello.getActiveUcc()
A method to get an active ucc and invite link for the currently logged in user.
{ ucc, link }
Cello.updateToken(token)
Updates the token and also verifies it.
Type | Type | Required |
---|---|---|
token | string | yes |
Promise<configuration>
Cello.changeLanguage(language)
A method to change the language of the Referral component at runtime without re-initialising it.
Type | Type | Required |
---|---|---|
language | string | yes |
jetifier
, add those two lines to your gradle.properties
file:
android.useAndroidX=true
android.enableJetifier=true
dependencies
in ./android/app/build.gradle
:
implementation 'androidx.appcompat:appcompat:1.6.1'
jest.mock
function with the library:
// jest/setup.ts
jest.mock('@getcello/cello-react-native', () => jest.fn());
👤 Cello (https://www.cello.so/)
Give a ⭐️ if this project helped you!
This project is MIT licensed.
Created with ❤️ by Cello
FAQs
React Native wrapper to bridge iOS and Android SDK
The npm package @getcello/cello-react-native receives a total of 7,240 weekly downloads. As such, @getcello/cello-react-native popularity was classified as popular.
We found that @getcello/cello-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Product
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
Industry Insights
Terry O’Daniel, Head of Security at Amplitude, shares insights on building high-impact security teams, aligning with engineering, and why AI gives defenders a fighting chance.
Security News
MCP spec updated with structured tool output, stronger OAuth 2.1 security, resource indicators, and protocol cleanups for safer, more reliable AI workflows.