@munkhorgil98/rn-erxes-sdk
v0.3.0
Published
react-native erxes sdk
Downloads
200
Readme
Achieving growth and unity within your company is possible with erxes, because it is:
- 100% free & sustainable: erxes offers a sustainable business model in which both developers and users win. It is open-source software, but even better.
- 100% customizable: Our plugin-based architecture provides unlimited customization and lets you meet all your needs, no matter how specific they are.
- 100% privacy: We've designed the erxes platform to retain complete control over your company's sensitive data with no third-party monitoring.
- 100% in control: You can build any experience you want, where all the channels your business operates on are connected and integrated.
What does erxes mean? How do you pronounce it?
erxes (pronounced 'erk-sis') means "heavenly bodies" in Mongolian. It is branded as “erxes” with all lowercase letters.
What is erxes?
erxes is a secure, self-hosted, and scalable open-source experience operating system (XOS) that enables SaaS providers and digital marketing agencies/developers to create unique experiences that work for all types of business. You can learn more about erxes architecture in our documentation.
erxes XOS & Plugins
erxes is composed of 2 main components: XOS & Plugins
XOS: It contains the project's core. You can find the admin panel and the code that runs different plugins. The operating system comes with utility features that allow users to customize, improve speed, and enhance the experience along with plugins/features.
Plugins: erxes comes with a set of plugins that allow you to create unique customer experiences. Below is a list of some plugins you can choose from our marketplace after you’ve finished installing erxes XOS:
- Team Inbox - Combine real-time client and team communication with in-app messaging, live chat, email, and form, so your customers can reach you, however, and whenever they want.
- Messenger - Enable businesses to capture every single customer feedback and educate customers through knowledge-base right from the erxes Messenger.
- Sales Management - Easy and clear sales funnels allow you to control your sales pipeline from one responsive field by precisely analyzing your progress and determining your next best move for success.
- Lead generation - Turn regular visitors into qualified leads by capturing them with a customizable landing page, forms, pop-up, or embed placements.
- Engage - Start converting your prospects into potential customers through email, SMS, messenger, or more interactions to drive them to a successful close.
- Contact Management - Access our all-in-one CRM system in one go, so it’s easier to coordinate and manage your customer interactions.
- Knowledgebase - Educate your customers and staff by creating a help center related to your brands, products, and services to reach a higher level of satisfaction.
- Task Management - Create a more collaborative, self-reliant and cross-linked team. See more on our website.
Usage
rn-erxes-sdk
A React Native bridge for the native SwiftUI erxes messenger
(erxes/erxes-ios-sdk 0.30.6).
Supports the classic widget and the full-screen chat mode (with voice
messages and header/drawer actions).
import { ErxesNativeIOS } from '@munkhorgil98/rn-erxes-sdk';Requirements
| | | |---|---| | iOS | 16.0+ | | Swift | 5.9+ | | React Native | 0.81+ | | Expo SDK | 53+ (development build or prebuild — Expo Go not supported) |
Docs
Installation
Bare React Native
yarn add @munkhorgil98/rn-erxes-sdk
cd ios && pod installExpo
npx expo install @munkhorgil98/rn-erxes-sdk expo-build-propertiesAdd to app.json:
{
"plugins": [
["expo-build-properties", { "ios": { "deploymentTarget": "16.0" } }]
]
}npx expo prebuild --platform ios
cd ios && pod install
npx expo run:iosInstalling from GitHub Packages
The package is also published to the GitHub Packages npm registry as @erxes/rn-erxes-sdk.
Because GitHub Packages requires authentication even for reads, add an .npmrc to your project that routes the @erxes scope to GitHub and supplies a personal access token with the read:packages scope:
# .npmrc
@erxes:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}Then export the token and install the scoped package:
export GITHUB_TOKEN=ghp_your_token_with_read_packages
yarn add @erxes/rn-erxes-sdk
cd ios && pod installThe default npmjs.org package (
@munkhorgil98/rn-erxes-sdk) needs no authentication — use GitHub Packages only if your org standardizes on it.
Usage
Call configure once at startup. It connects in the background so the messenger opens instantly.
import { ErxesNativeIOS } from '@munkhorgil98/rn-erxes-sdk';
ErxesNativeIOS.configure({
integrationId: 'YOUR_INTEGRATION_ID',
subDomain: 'yourcompany.erxes.io',
});Optionally identify the user:
ErxesNativeIOS.setUser({
email: '[email protected]',
name: 'Jane Doe',
customData: { plan: 'pro' },
});Option A — Floating launcher (recommended)
Shows a draggable button over your app. Tapping it opens the messenger automatically.
ErxesNativeIOS.showLauncher();
// ErxesNativeIOS.hideLauncher(); // to remove itOption B — Your own button
If you have a custom trigger in your UI, call showMessenger() directly:
<Button title="Support" onPress={() => ErxesNativeIOS.showMessenger()} />Chat mode
Pass displayMode: 'chat' for the full-screen assistant shell (it auto-opens
when connected, so showLauncher() is a no-op). You can add header/drawer
actions and react to taps by id:
ErxesNativeIOS.configure({
integrationId: 'YOUR_INTEGRATION_ID',
subDomain: 'yourcompany.erxes.io',
displayMode: 'chat',
homeActions: [{ id: 'orders', title: 'My Orders', systemIcon: 'bag' }],
drawerActions: [{ id: 'settings', title: 'Settings', systemIcon: 'gearshape' }],
});
const sub = ErxesNativeIOS.addActionListener((id) => {
// navigate / open a modal based on id
});
// sub.remove() on cleanupChat mode also supports voice messages — see the Native iOS guide for the required Info.plist permissions.
On logout:
ErxesNativeIOS.clearUser();Full example: Native iOS guide.
Troubleshooting
Confirm the installed version
yarn list --pattern @munkhorgil98/rn-erxes-sdkor:
npm ls @munkhorgil98/rn-erxes-sdkUpgrade the SDK
yarn add @munkhorgil98/rn-erxes-sdk@latestor:
npm install --save @munkhorgil98/rn-erxes-sdk@latestAfter upgrading, reinstall pods and rebuild the app:
cd ios
pod installExpo Go
This package uses native Swift code and does not run in Expo Go. Use an Expo development build or a bare React Native app.
Maintainer workflow
This repository requires Node.js >=20.19.0 and Yarn Classic 1.22.22.
corepack enable
corepack prepare [email protected] --activate
yarn install
yarn typecheck
yarn lint
yarn test
yarn prepack
npm pack --dry-runThe example app uses Expo SDK 54, React 19.1.0, and React Native 0.81.5, and aliases @munkhorgil98/rn-erxes-sdk to the root src directory for local development:
cd example
yarn install
npx expo start --clearRelease
Publishing is automated by .github/workflows/publish.yml, which runs on GitHub Release publish and pushes to both registries in parallel:
- npm →
@munkhorgil98/rn-erxes-sdk(public). Uses theNPM_TOKENrepository secret, published with--access public(scoped packages are private by default) and--provenance(adds a verified "built from this repo" badge on npm; requires the job'sid-token: writepermission). - GitHub Packages →
@erxes/rn-erxes-sdk. Uses the built-inGITHUB_TOKEN(no secret to configure). The job rewrites the package name/registry at CI time only, so the committedpackage.jsonkeeps the@munkhorgil98npm name.
Cutting a release
- Bump
versioninpackage.json(e.g.0.2.7→0.2.8). - Commit and merge to
main— the workflow only triggers from the default branch, so the new version and workflow must be onmainbefore you release. - Create a GitHub Release at https://github.com/erxes/rn-erxes-sdk/releases/new:
- Tag:
v<version>(must be new — a published npm version can't be reused), "Create new tag on publish" - Target:
main - Publish release → both jobs run at https://github.com/erxes/rn-erxes-sdk/actions.
- Tag:
- Verify:
npm view @munkhorgil98/rn-erxes-sdk version.
One-time setup (already done, for reference)
NPM_TOKENsecret — a Granular Access Token from https://www.npmjs.com/settings/munkhorgil98/tokens with Read and write on the@munkhorgil98scope, added under repo Settings → Secrets and variables → Actions.- npm account 2FA must be set to "Authorization only" (uncheck "Require 2FA for write actions" at https://www.npmjs.com/settings/munkhorgil98/profile), otherwise CI publishing fails with
EOTP.
Troubleshooting
404 Not Found - PUT .../@scope%2f...— the scope doesn't match the npm account, or the token can't create the package. The package name's scope must equal your npm username (@munkhorgil98), and the token needs write access to that scope.EOTP(one-time password required) — the account still requires 2FA for writes. Set 2FA to "Authorization only" (and confirm the change with your OTP so it persists).401 / ENEEDAUTH— theNPM_TOKENsecret is missing/invalid; regenerate the token and update the secret.- After fixing a token/secret, just re-run the failed job in the Actions tab — no new version needed.
- Each release requires a new version; a published version cannot be republished.
Manual fallback
If you need to publish from your machine (e.g. CI is unavailable):
git checkout main && git pull
yarn install
npm publish --access public # add --otp=<code> if 2FA-on-writes is enabled
npm view @munkhorgil98/rn-erxes-sdk versionBecome a partner
Offer your expertise to the world and introduce your community to erxes. Let’s start growing together.
Contributing
Please read our contributing guide before submitting a Pull Request to the project.
Community support
For general help using erxes, please refer to the erxes documentation. For additional help, you can use one of these channels to ask a question:
- Discord For live discussion with the community
- GitHub Bug reports, contributions
- Feedback section Roadmap, feature requests & bugs
- Twitter Get the news fast
Upgrade Guides
Follow our upgrade guides on the documentation to keep your erxes code up-to-date. See our dedicated repository for the erxes documentation, or view our documentation here.
License
See the LICENSE file for licensing information.
