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

expo-cxonemobilesdk

v0.2.2

Published

Mobile SDK lets you integrate CXone Mpower digital chat into your enterprise mobile phone apps.

Readme

expo-cxonemobilesdk

Expo module that wraps the native NICE CXoneChat SDKs and exposes a unified TypeScript API for iOS and Android. The package bundles Swift/Kotlin shims, a config-plugin for Swift Package injection, and an example app built with Expo Router.

Highlights

  • Explicit Connection.prepare + Connection.connect flow with listener-first state management (chatUpdated, connectionError, etc.).
  • Full multithread surface (Threads.* + Thread.*) including attachments, pre-chat surveys, and typing indicators.
  • Customer identity, OAuth, visitor IDs, and custom fields scoped either to the visitor or individual threads.
  • Analytics helpers (viewPage, conversion, …) so you can capture chat funnel metrics directly from React Native.

Quick start

  1. Install the package and its peer tooling:

    yarn add expo-cxonemobilesdk
    npx pod-install
  2. Android AARs are vendored in the package (nice-cxone-mobile-sdk-android/) so no additional Maven repositories or GitHub Packages credentials are required. Gradle picks up the local artifacts automatically when the module is installed.

  3. Connect and send a message:

    import { Connection, Threads, Thread, Customer, Analytics } from 'expo-cxonemobilesdk';
    
    await Connection.prepare('NA1', 1234, 'chat_channel');
    await Connection.connect();
    const mode = Connection.getChatMode();
    
    const created = await Threads.create();
    await Thread.send(created.id, { text: 'Hello from Expo' });
    await Analytics.chatWindowOpen();

Refer to docs/setup.md for full installation details, optional Swift Package injection via the config-plugin, and example environment variables.

Documentation

All documentation now lives in docs/. Start with:

Each file spells out the JS helper, native counterpart, and relevant example-app wiring.

Example app

The example/ directory is a runnable Expo Router app that exercises all APIs:

cd example
cp .env.example .env   # fill in your CXone env/brand/channel
yarn
npx expo prebuild -p ios
cd ios && pod install --repo-update
cd ..
yarn ios

Shared UI and hooks live in example/app/components/* so Router screens stay lightweight. Message rendering is event-driven—no optimistic/pending states in JS.

The example expects these environment variables inside example/.env (copied from .env.example):

EXPO_PUBLIC_CHAT_ENV=YOUR_ENV_CODE   # e.g. EU1
EXPO_PUBLIC_CHAT_BRAND_ID=YOUR_BRAND_ID
EXPO_PUBLIC_CHAT_CHANNEL_ID=YOUR_CHANNEL_ID   # e.g. chat_xxx

Platform dissimilarities

  • Channel configuration — both platforms return the same JSON shape, but fileRestrictions.allowedFileSize may be a number or { minKb, maxKb } depending on what the SDK reports.
  • Customer identity getters — iOS reads the identity from the SDK provider. Android returns the last value set by JS because the SDK lacks a getter.
  • Thread pagination — Android’s Thread.loadMore resolves with an updated thread snapshot. iOS triggers pagination internally; call Thread.getDetails (or rely on threadUpdated) for the refreshed messages.
  • Custom field lifetime — CXone clears customer and thread custom fields on Connection.signOut(). Persist values externally and reapply them after reconnecting.

Document new differences here (and update the relevant doc file + TypeScript types) whenever the native SDKs diverge.

Contributing

Contributions are welcome! Please follow the Expo contributing guide and keep the docs/ folder updated when you add native/TS APIs.

Formatting

  • yarn format / yarn format:check — Prettier for JS/TS.
  • brew install swift-format then yarn format:swift / yarn format:swift:check — Apple swift-format for Swift.

Troubleshooting

  • After editing Swift files, rerun pod install inside example/ios so Xcode sees the new sources.
  • Build errors referencing CXoneChatSDK usually mean the Swift Package reference did not resolve. Re-run the config-plugin via npx expo prebuild -p ios, then cd ios && pod install --repo-update.
  • Android manifest merge failures mentioning android:fullBackupContent come from the CXone chat-sdk-core AAR also defining that attribute. Add tools:replace="android:fullBackupContent" to your app’s <application> element (with the tools namespace declared) to keep your existing backup rules.