react-native-nexora 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nexora
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/Nexora.podspec ADDED
@@ -0,0 +1,22 @@
1
+ require "json"
2
+
3
+ package = JSON.parse(File.read(File.join(__dir__, "package.json")))
4
+
5
+ Pod::Spec.new do |s|
6
+ s.name = "Nexora"
7
+ s.version = package["version"]
8
+ s.summary = package["description"]
9
+ s.homepage = package["homepage"]
10
+ s.license = package["license"]
11
+ s.authors = package["author"]
12
+
13
+ s.platforms = { :ios => "15.0" }
14
+ s.source = { :git => "https://github.com/ksanexora/nexora_react_native_sdk.git", :tag => "#{s.version}" }
15
+
16
+ s.source_files = "ios/**/*.{h,m,mm,swift,cpp}"
17
+ s.private_header_files = "ios/**/*.h"
18
+
19
+ s.dependency "NexoraSDK", "0.0.22"
20
+
21
+ install_modules_dependencies(s)
22
+ end
package/README.md CHANGED
@@ -1,3 +1,37 @@
1
- # Temporary Holding Version
1
+ # react-native-nexora
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A React Native SDK for Nexora Apps
4
+
5
+ ## Installation
6
+
7
+
8
+ ```sh
9
+ npm install react-native-nexora
10
+ ```
11
+
12
+
13
+ ## Usage
14
+
15
+
16
+ ```js
17
+ import { multiply } from 'react-native-nexora';
18
+
19
+ // ...
20
+
21
+ const result = multiply(3, 7);
22
+ ```
23
+
24
+
25
+ ## Contributing
26
+
27
+ - [Development workflow](CONTRIBUTING.md#development-workflow)
28
+ - [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
29
+ - [Code of conduct](CODE_OF_CONDUCT.md)
30
+
31
+ ## License
32
+
33
+ MIT
34
+
35
+ ---
36
+
37
+ Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
@@ -0,0 +1,56 @@
1
+ buildscript {
2
+ ext.Nexora = [
3
+ kotlinVersion: "2.0.21",
4
+ minSdkVersion: 24,
5
+ compileSdkVersion: 36
6
+ ]
7
+
8
+ ext.getExtOrDefault = { prop ->
9
+ if (rootProject.ext.has(prop)) {
10
+ return rootProject.ext.get(prop)
11
+ }
12
+
13
+ return Nexora[prop]
14
+ }
15
+
16
+ repositories {
17
+ google()
18
+ mavenCentral()
19
+ }
20
+
21
+ dependencies {
22
+ classpath "com.android.tools.build:gradle:8.7.2"
23
+ // noinspection DifferentKotlinGradleVersion
24
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
25
+ }
26
+ }
27
+
28
+
29
+ apply plugin: "com.android.library"
30
+
31
+ if (project.extensions.findByName("kotlin") == null) {
32
+ apply plugin: "kotlin-android"
33
+ }
34
+
35
+
36
+ apply plugin: "com.facebook.react"
37
+
38
+ android {
39
+ namespace "com.nexora"
40
+
41
+ compileSdkVersion getExtOrDefault("compileSdkVersion")
42
+
43
+ defaultConfig {
44
+ minSdkVersion getExtOrDefault("minSdkVersion")
45
+ }
46
+
47
+ compileOptions {
48
+ sourceCompatibility JavaVersion.VERSION_17
49
+ targetCompatibility JavaVersion.VERSION_17
50
+ }
51
+ }
52
+
53
+ dependencies {
54
+ implementation "com.facebook.react:react-android"
55
+ implementation "com.usenexora:nexora-sdk:1.0.3"
56
+ }
@@ -0,0 +1,2 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+ </manifest>
@@ -0,0 +1,100 @@
1
+ package com.nexora
2
+
3
+ import com.facebook.react.bridge.ReactApplicationContext
4
+ import com.facebook.react.bridge.ReadableMap
5
+ import com.facebook.react.bridge.Promise
6
+ import com.usenexora.sdk.Nexora
7
+
8
+ class NexoraModule(reactContext: ReactApplicationContext) :
9
+ NativeNexoraSpec(reactContext) {
10
+
11
+ private val context: ReactApplicationContext = reactContext
12
+
13
+ override fun getDefaultInstance() {
14
+ try {
15
+ Nexora.getDefaultInstance(context)
16
+ } catch (e: Exception) {
17
+ e.printStackTrace()
18
+ }
19
+ }
20
+
21
+ override fun pushEvent(name: String, properties: ReadableMap) {
22
+ try {
23
+ Nexora.pushEvent(name, properties.toHashMap())
24
+ } catch (e: Exception) {
25
+ e.printStackTrace()
26
+ }
27
+ }
28
+
29
+ override fun onUserLogin(profile: ReadableMap) {
30
+ try {
31
+ Nexora.onUserLogin(profile.toHashMap())
32
+ } catch (e: Exception) {
33
+ e.printStackTrace()
34
+ }
35
+ }
36
+
37
+ override fun pushProfile(profile: ReadableMap) {
38
+ try {
39
+ Nexora.pushProfile(profile.toHashMap())
40
+ } catch (e: Exception) {
41
+ e.printStackTrace()
42
+ }
43
+ }
44
+
45
+ override fun logout() {
46
+ try {
47
+ Nexora.logout()
48
+ } catch (e: Exception) {
49
+ e.printStackTrace()
50
+ }
51
+ }
52
+
53
+ override fun setPushToken(token: String) {
54
+ try {
55
+ Nexora.setPushToken(token)
56
+ } catch (e: Exception) {
57
+ e.printStackTrace()
58
+ }
59
+ }
60
+
61
+ override fun setFirebaseToken(token: String) {
62
+ try {
63
+ Nexora.setPushToken(token)
64
+ } catch (e: Exception) {
65
+ e.printStackTrace()
66
+ }
67
+ }
68
+
69
+ override fun setLog(logLevel: String, enabled: Boolean) {
70
+ try {
71
+ Nexora.setLog(logLevel, enabled)
72
+ } catch (e: Exception) {
73
+ e.printStackTrace()
74
+ }
75
+ }
76
+
77
+ override fun getNexoraId(promise: Promise) {
78
+ try {
79
+ promise.resolve(Nexora.getNexoraId())
80
+ } catch (e: Exception) {
81
+ promise.reject("NEXORA_ERROR", e.message, e)
82
+ }
83
+ }
84
+
85
+ override fun getProfileProperty(key: String, promise: Promise) {
86
+ try {
87
+ promise.resolve(Nexora.getProfileProperty(key))
88
+ } catch (e: Exception) {
89
+ promise.reject("NEXORA_ERROR", e.message, e)
90
+ }
91
+ }
92
+
93
+ override fun setDeviceToken(token: String) {
94
+ // No-op on Android
95
+ }
96
+
97
+ companion object {
98
+ const val NAME = NativeNexoraSpec.NAME
99
+ }
100
+ }
@@ -0,0 +1,31 @@
1
+ package com.nexora
2
+
3
+ import com.facebook.react.BaseReactPackage
4
+ import com.facebook.react.bridge.NativeModule
5
+ import com.facebook.react.bridge.ReactApplicationContext
6
+ import com.facebook.react.module.model.ReactModuleInfo
7
+ import com.facebook.react.module.model.ReactModuleInfoProvider
8
+ import java.util.HashMap
9
+
10
+ class NexoraPackage : BaseReactPackage() {
11
+ override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
12
+ return if (name == NexoraModule.NAME) {
13
+ NexoraModule(reactContext)
14
+ } else {
15
+ null
16
+ }
17
+ }
18
+
19
+ override fun getReactModuleInfoProvider() = ReactModuleInfoProvider {
20
+ mapOf(
21
+ NexoraModule.NAME to ReactModuleInfo(
22
+ name = NexoraModule.NAME,
23
+ className = NexoraModule.NAME,
24
+ canOverrideExistingModule = false,
25
+ needsEagerInit = false,
26
+ isCxxModule = false,
27
+ isTurboModule = true
28
+ )
29
+ )
30
+ }
31
+ }
package/ios/Nexora.h ADDED
@@ -0,0 +1,6 @@
1
+ #import <NexoraSpec/NexoraSpec.h>
2
+ #import <React/RCTBridgeModule.h>
3
+
4
+ @interface NexoraBridge : NSObject <NativeNexoraSpec, RCTBridgeModule>
5
+
6
+ @end
package/ios/Nexora.mm ADDED
@@ -0,0 +1,93 @@
1
+ #import "Nexora.h"
2
+ #import <React/RCTLog.h>
3
+ #import <React/RCTBridgeModule.h>
4
+
5
+ // Forward declare the Swift wrapper we created
6
+ @interface NexoraRNWrapper : NSObject
7
+ + (void)configureWithBaseURL:(NSString *)baseURL apiKey:(NSString *)apiKey clientId:(NSString *)clientId projectId:(NSString *)projectId appGroupId:(NSString *)appGroupId;
8
+ + (void)trackEventWithName:(NSString *)name properties:(NSDictionary *)properties;
9
+ + (void)identifyWithUserID:(NSString *)userID email:(NSString *)email mobile:(NSString *)mobile name:(NSString *)name;
10
+ + (void)setDeviceToken:(NSString *)token;
11
+ + (void)setFirebaseToken:(NSString *)token;
12
+ + (void)setLogWithLevel:(NSString *)level enabled:(BOOL)enabled;
13
+ + (void)logout;
14
+ @end
15
+
16
+ @implementation NexoraBridge
17
+
18
+ RCT_EXPORT_MODULE(Nexora)
19
+
20
+ + (BOOL)requiresMainQueueSetup
21
+ {
22
+ return YES;
23
+ }
24
+
25
+ - (void)getDefaultInstance {
26
+ NSDictionary *info = [[NSBundle mainBundle] infoDictionary];
27
+ NSString *baseURL = info[@"NexoraBaseURL"] ?: @"";
28
+ NSString *apiKey = info[@"NexoraAPIKey"] ?: @"";
29
+ NSString *clientId = info[@"NexoraClientID"] ?: @"";
30
+ NSString *projectId = info[@"NexoraProjectID"] ?: @"";
31
+ NSString *appGroupId = info[@"NexoraAppGroupID"];
32
+
33
+ if (baseURL.length > 0 && apiKey.length > 0 && projectId.length > 0 && clientId.length > 0) {
34
+ [NexoraRNWrapper configureWithBaseURL:baseURL apiKey:apiKey clientId:clientId projectId:projectId appGroupId:appGroupId];
35
+ } else {
36
+ RCTLogError(@"Nexora React Native SDK: Missing required Info.plist keys");
37
+ }
38
+ }
39
+
40
+ - (void)pushEvent:(NSString *)name properties:(NSDictionary *)properties {
41
+ [NexoraRNWrapper trackEventWithName:name properties:properties];
42
+ }
43
+
44
+ - (void)onUserLogin:(NSDictionary *)profile {
45
+ NSString *userID = profile[@"user_id"] ? [NSString stringWithFormat:@"%@", profile[@"user_id"]] : nil;
46
+ NSString *email = profile[@"email"] ? [NSString stringWithFormat:@"%@", profile[@"email"]] : nil;
47
+ NSString *mobile = profile[@"mobile"] ? [NSString stringWithFormat:@"%@", profile[@"mobile"]] : nil;
48
+ NSString *name = profile[@"name"] ? [NSString stringWithFormat:@"%@", profile[@"name"]] : nil;
49
+
50
+ [NexoraRNWrapper identifyWithUserID:userID email:email mobile:mobile name:name];
51
+ }
52
+
53
+ - (void)pushProfile:(NSDictionary *)profile {
54
+ [self onUserLogin:profile]; // Same logic as Flutter plugin
55
+ }
56
+
57
+ - (void)logout {
58
+ [NexoraRNWrapper logout];
59
+ }
60
+
61
+ - (void)setPushToken:(NSString *)token {
62
+ [NexoraRNWrapper setFirebaseToken:token];
63
+ }
64
+
65
+ - (void)setLog:(NSString *)logLevel enabled:(BOOL)enabled {
66
+ [NexoraRNWrapper setLogWithLevel:logLevel enabled:enabled];
67
+ }
68
+
69
+ - (void)getNexoraId:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
70
+ NSString *nexoraId = [[NSUserDefaults standardUserDefaults] stringForKey:@"com.nexora.nexora_id"];
71
+ resolve(nexoraId ?: [NSNull null]);
72
+ }
73
+
74
+ - (void)getProfileProperty:(NSString *)key resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
75
+ // Not yet implemented in Native iOS SDK
76
+ resolve([NSNull null]);
77
+ }
78
+
79
+ - (void)setDeviceToken:(NSString *)token {
80
+ [NexoraRNWrapper setDeviceToken:token];
81
+ }
82
+
83
+ - (void)setFirebaseToken:(NSString *)token {
84
+ [NexoraRNWrapper setFirebaseToken:token];
85
+ }
86
+
87
+ - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
88
+ (const facebook::react::ObjCTurboModule::InitParams &)params
89
+ {
90
+ return std::make_shared<facebook::react::NativeNexoraSpecJSI>(params);
91
+ }
92
+
93
+ @end
@@ -0,0 +1,81 @@
1
+ import Foundation
2
+ import NexoraSDK
3
+
4
+ @objc(NexoraRNWrapper)
5
+ public class NexoraRNWrapper: NSObject {
6
+
7
+ @objc
8
+ public static func configure(baseURL: String, apiKey: String, clientId: String, projectId: String, appGroupId: String?) {
9
+ Nexora.shared.configure(
10
+ baseURLString: baseURL,
11
+ apiKey: apiKey,
12
+ clientId: clientId,
13
+ projectID: projectId,
14
+ launchOptions: nil,
15
+ appGroupID: appGroupId
16
+ )
17
+ }
18
+
19
+ @objc
20
+ public static func trackEvent(name: String, properties: [String: Any]?) {
21
+ let codableProps = properties.map { toCodableDict($0) }
22
+ Nexora.shared.trackEvent(
23
+ name: name,
24
+ properties: codableProps,
25
+ liveActivityTokenProperties: nil,
26
+ liveActivityProperties: nil
27
+ )
28
+ }
29
+
30
+ @objc
31
+ public static func identify(userID: String?, email: String?, mobile: String?, name: String?) {
32
+ Nexora.shared.identify(userID: userID, email: email, mobile: mobile, name: name)
33
+ }
34
+
35
+ @objc
36
+ public static func setDeviceToken(_ token: String) {
37
+ Nexora.shared.setDeviceToken(token)
38
+ }
39
+
40
+ @objc
41
+ public static func setFirebaseToken(_ token: String) {
42
+ Nexora.shared.setFirebaseToken(token)
43
+ }
44
+
45
+ @objc
46
+ public static func setLog(level: String, enabled: Bool) {
47
+ Nexora.shared.setLog(level: level, enabled: enabled)
48
+ }
49
+
50
+ @objc
51
+ public static func logout() {
52
+ Nexora.shared.logout()
53
+ }
54
+
55
+ // MARK: - Helpers
56
+ private static func toCodableDict(_ dict: [String: Any]) -> [String: CodableValue] {
57
+ var codableDict: [String: CodableValue] = [:]
58
+ for (key, value) in dict {
59
+ codableDict[key] = toCodableValue(value)
60
+ }
61
+ return codableDict
62
+ }
63
+
64
+ private static func toCodableValue(_ value: Any) -> CodableValue {
65
+ if let boolVal = value as? Bool {
66
+ return .bool(boolVal)
67
+ } else if let intVal = value as? Int {
68
+ return .int(intVal)
69
+ } else if let doubleVal = value as? Double {
70
+ return .double(doubleVal)
71
+ } else if let strVal = value as? String {
72
+ return .string(strVal)
73
+ } else if let dictVal = value as? [String: Any] {
74
+ return .dictionary(toCodableDict(dictVal))
75
+ } else if let arrVal = value as? [Any] {
76
+ return .array(arrVal.map { toCodableValue($0) })
77
+ }
78
+ return .null
79
+ }
80
+ }
81
+
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ import { TurboModuleRegistry } from 'react-native';
4
+ export default TurboModuleRegistry.getEnforcing('Nexora');
5
+ //# sourceMappingURL=NativeNexora.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeNexora.ts"],"mappings":";;AACA,SAAQA,mBAAmB,QAAO,cAAc;AAgBhD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,QAAQ,CAAC","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ import Nexora from "./NativeNexora.js";
4
+ export function getDefaultInstance() {
5
+ Nexora.getDefaultInstance();
6
+ }
7
+ export function pushEvent(name, properties) {
8
+ Nexora.pushEvent(name, properties);
9
+ }
10
+ export function onUserLogin(profile) {
11
+ Nexora.onUserLogin(profile);
12
+ }
13
+ export function pushProfile(profile) {
14
+ Nexora.pushProfile(profile);
15
+ }
16
+ export function logout() {
17
+ Nexora.logout();
18
+ }
19
+ export function setPushToken(token) {
20
+ Nexora.setPushToken(token);
21
+ }
22
+ export function setLog(logLevel, enabled) {
23
+ Nexora.setLog(logLevel, enabled);
24
+ }
25
+ export function getNexoraId() {
26
+ return Nexora.getNexoraId();
27
+ }
28
+ export function getProfileProperty(key) {
29
+ return Nexora.getProfileProperty(key);
30
+ }
31
+ export function setDeviceToken(token) {
32
+ Nexora.setDeviceToken(token);
33
+ }
34
+ export function setFirebaseToken(token) {
35
+ Nexora.setFirebaseToken(token);
36
+ }
37
+ export default {
38
+ getDefaultInstance,
39
+ pushEvent,
40
+ onUserLogin,
41
+ pushProfile,
42
+ logout,
43
+ setPushToken,
44
+ setLog,
45
+ getNexoraId,
46
+ getProfileProperty,
47
+ setDeviceToken,
48
+ setFirebaseToken
49
+ };
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Nexora","getDefaultInstance","pushEvent","name","properties","onUserLogin","profile","pushProfile","logout","setPushToken","token","setLog","logLevel","enabled","getNexoraId","getProfileProperty","key","setDeviceToken","setFirebaseToken"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,OAAOA,MAAM,MAAM,mBAAgB;AAEnC,OAAO,SAASC,kBAAkBA,CAAA,EAAS;EACzCD,MAAM,CAACC,kBAAkB,CAAC,CAAC;AAC7B;AAEA,OAAO,SAASC,SAASA,CAACC,IAAY,EAAEC,UAA+B,EAAQ;EAC7EJ,MAAM,CAACE,SAAS,CAACC,IAAI,EAAEC,UAAU,CAAC;AACpC;AAEA,OAAO,SAASC,WAAWA,CAACC,OAA4B,EAAQ;EAC9DN,MAAM,CAACK,WAAW,CAACC,OAAO,CAAC;AAC7B;AAEA,OAAO,SAASC,WAAWA,CAACD,OAA4B,EAAQ;EAC9DN,MAAM,CAACO,WAAW,CAACD,OAAO,CAAC;AAC7B;AAEA,OAAO,SAASE,MAAMA,CAAA,EAAS;EAC7BR,MAAM,CAACQ,MAAM,CAAC,CAAC;AACjB;AAEA,OAAO,SAASC,YAAYA,CAACC,KAAa,EAAQ;EAChDV,MAAM,CAACS,YAAY,CAACC,KAAK,CAAC;AAC5B;AAEA,OAAO,SAASC,MAAMA,CAACC,QAAgB,EAAEC,OAAgB,EAAQ;EAC/Db,MAAM,CAACW,MAAM,CAACC,QAAQ,EAAEC,OAAO,CAAC;AAClC;AAEA,OAAO,SAASC,WAAWA,CAAA,EAAoB;EAC7C,OAAOd,MAAM,CAACc,WAAW,CAAC,CAAC;AAC7B;AAEA,OAAO,SAASC,kBAAkBA,CAACC,GAAW,EAAgB;EAC5D,OAAOhB,MAAM,CAACe,kBAAkB,CAACC,GAAG,CAAC;AACvC;AAEA,OAAO,SAASC,cAAcA,CAACP,KAAa,EAAQ;EAClDV,MAAM,CAACiB,cAAc,CAACP,KAAK,CAAC;AAC9B;AAEA,OAAO,SAASQ,gBAAgBA,CAACR,KAAa,EAAQ;EACpDV,MAAM,CAACkB,gBAAgB,CAACR,KAAK,CAAC;AAChC;AAEA,eAAe;EACbT,kBAAkB;EAClBC,SAAS;EACTG,WAAW;EACXE,WAAW;EACXC,MAAM;EACNC,YAAY;EACZE,MAAM;EACNG,WAAW;EACXC,kBAAkB;EAClBE,cAAc;EACdC;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,17 @@
1
+ import type { TurboModule } from 'react-native';
2
+ export interface Spec extends TurboModule {
3
+ getDefaultInstance(): void;
4
+ pushEvent(name: string, properties: Object): void;
5
+ onUserLogin(profile: Object): void;
6
+ pushProfile(profile: Object): void;
7
+ logout(): void;
8
+ setPushToken(token: string): void;
9
+ setLog(logLevel: string, enabled: boolean): void;
10
+ getNexoraId(): Promise<string>;
11
+ getProfileProperty(key: string): Promise<Object>;
12
+ setDeviceToken(token: string): void;
13
+ setFirebaseToken(token: string): void;
14
+ }
15
+ declare const _default: Spec;
16
+ export default _default;
17
+ //# sourceMappingURL=NativeNexora.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeNexora.d.ts","sourceRoot":"","sources":["../../../src/NativeNexora.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,cAAc,CAAC;AAG9C,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,kBAAkB,IAAI,IAAI,CAAC;IAC3B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,MAAM,IAAI,IAAI,CAAC;IACf,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IACjD,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/B,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;;AAED,wBAAgE"}
@@ -0,0 +1,26 @@
1
+ export declare function getDefaultInstance(): void;
2
+ export declare function pushEvent(name: string, properties: Record<string, any>): void;
3
+ export declare function onUserLogin(profile: Record<string, any>): void;
4
+ export declare function pushProfile(profile: Record<string, any>): void;
5
+ export declare function logout(): void;
6
+ export declare function setPushToken(token: string): void;
7
+ export declare function setLog(logLevel: string, enabled: boolean): void;
8
+ export declare function getNexoraId(): Promise<string>;
9
+ export declare function getProfileProperty(key: string): Promise<any>;
10
+ export declare function setDeviceToken(token: string): void;
11
+ export declare function setFirebaseToken(token: string): void;
12
+ declare const _default: {
13
+ getDefaultInstance: typeof getDefaultInstance;
14
+ pushEvent: typeof pushEvent;
15
+ onUserLogin: typeof onUserLogin;
16
+ pushProfile: typeof pushProfile;
17
+ logout: typeof logout;
18
+ setPushToken: typeof setPushToken;
19
+ setLog: typeof setLog;
20
+ getNexoraId: typeof getNexoraId;
21
+ getProfileProperty: typeof getProfileProperty;
22
+ setDeviceToken: typeof setDeviceToken;
23
+ setFirebaseToken: typeof setFirebaseToken;
24
+ };
25
+ export default _default;
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAE7E;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAE9D;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAE9D;AAED,wBAAgB,MAAM,IAAI,IAAI,CAE7B;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAE/D;AAED,wBAAgB,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,CAE7C;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAE5D;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAElD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAEpD;;;;;;;;;;;;;;AAED,wBAYE"}
package/package.json CHANGED
@@ -1,6 +1,191 @@
1
1
  {
2
2
  "name": "react-native-nexora",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "A React Native SDK for Nexora Apps",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "react-native-nexora-source": "./src/index.ts",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src",
17
+ "lib",
18
+ "android",
19
+ "ios",
20
+ "cpp",
21
+ "*.podspec",
22
+ "react-native.config.js",
23
+ "!ios/build",
24
+ "!android/build",
25
+ "!android/gradle",
26
+ "!android/gradlew",
27
+ "!android/gradlew.bat",
28
+ "!android/local.properties",
29
+ "!**/__tests__",
30
+ "!**/__fixtures__",
31
+ "!**/__mocks__",
32
+ "!**/.*"
33
+ ],
34
+ "scripts": {
35
+ "example": "yarn workspace react-native-nexora-example",
36
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
37
+ "prepare": "bob build",
38
+ "typecheck": "tsc",
39
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
40
+ "test": "jest",
41
+ "release": "release-it --only-version",
42
+ "web": "vite",
43
+ "build:web": "vite build"
44
+ },
45
+ "keywords": [
46
+ "react-native",
47
+ "ios",
48
+ "android"
49
+ ],
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/ksanexora/nexora_react_native_sdk.git"
53
+ },
54
+ "author": "Nexora <usenexora@gmail.com> (https://usenexora.com/)",
55
+ "license": "MIT",
56
+ "bugs": {
57
+ "url": "https://github.com/ksanexora/nexora_react_native_sdk/issues"
58
+ },
59
+ "homepage": "https://github.com/ksanexora/nexora_react_native_sdk#readme",
60
+ "publishConfig": {
61
+ "registry": "https://registry.npmjs.org/"
62
+ },
63
+ "devDependencies": {
64
+ "@commitlint/config-conventional": "^21.2.0",
65
+ "@eslint/compat": "^2.1.0",
66
+ "@eslint/eslintrc": "^3.3.6",
67
+ "@eslint/js": "^9.39.5",
68
+ "@jest/globals": "^29.7.0",
69
+ "@react-native/babel-preset": "0.86.2",
70
+ "@react-native/eslint-config": "0.86.2",
71
+ "@react-native/jest-preset": "0.86.2",
72
+ "@release-it/conventional-changelog": "^12.0.0",
73
+ "@types/react": "^19.2.0",
74
+ "commitlint": "^21.2.1",
75
+ "del-cli": "^7.0.0",
76
+ "eslint": "^9.39.5",
77
+ "eslint-config-prettier": "^10.1.8",
78
+ "eslint-plugin-ft-flow": "^3.0.11",
79
+ "eslint-plugin-prettier": "^5.5.6",
80
+ "jest": "^29.7.0",
81
+ "lefthook": "^2.1.10",
82
+ "prettier": "^3.9.6",
83
+ "react": "19.3.0",
84
+ "react-native": "0.86.2",
85
+ "react-native-builder-bob": "^0.43.1",
86
+ "react-native-web": "~0.21.2",
87
+ "release-it": "^21.0.1",
88
+ "turbo": "^2.10.8",
89
+ "typescript": "^6.0.3"
90
+ },
91
+ "peerDependencies": {
92
+ "react": "*",
93
+ "react-native": "*"
94
+ },
95
+ "workspaces": [
96
+ "example"
97
+ ],
98
+ "packageManager": "yarn@4.11.0",
99
+ "react-native-builder-bob": {
100
+ "source": "src",
101
+ "output": "lib",
102
+ "targets": [
103
+ [
104
+ "module",
105
+ {
106
+ "esm": true
107
+ }
108
+ ],
109
+ [
110
+ "typescript",
111
+ {
112
+ "project": "tsconfig.build.json"
113
+ }
114
+ ]
115
+ ]
116
+ },
117
+ "codegenConfig": {
118
+ "name": "NexoraSpec",
119
+ "type": "modules",
120
+ "jsSrcsDir": "src",
121
+ "android": {
122
+ "javaPackageName": "com.nexora"
123
+ },
124
+ "ios": {
125
+ "modulesProvider": {
126
+ "Nexora": "NexoraBridge"
127
+ }
128
+ }
129
+ },
130
+ "prettier": {
131
+ "quoteProps": "consistent",
132
+ "singleQuote": true,
133
+ "tabWidth": 2,
134
+ "trailingComma": "es5",
135
+ "useTabs": false
136
+ },
137
+ "jest": {
138
+ "preset": "@react-native/jest-preset",
139
+ "testEnvironmentOptions": {
140
+ "customExportConditions": [
141
+ "require",
142
+ "react-native",
143
+ "<%- project.sourceCondition -%>"
144
+ ]
145
+ },
146
+ "modulePathIgnorePatterns": [
147
+ "<rootDir>/example/node_modules",
148
+ "<rootDir>/lib/"
149
+ ]
150
+ },
151
+ "commitlint": {
152
+ "extends": [
153
+ "@commitlint/config-conventional"
154
+ ]
155
+ },
156
+ "release-it": {
157
+ "git": {
158
+ "commitMessage": "chore: release ${version}",
159
+ "tagName": "v${version}"
160
+ },
161
+ "npm": {
162
+ "publish": true
163
+ },
164
+ "github": {
165
+ "release": true
166
+ },
167
+ "plugins": {
168
+ "@release-it/conventional-changelog": {
169
+ "preset": {
170
+ "name": "angular"
171
+ }
172
+ }
173
+ }
174
+ },
175
+ "create-react-native-library": {
176
+ "type": "turbo-module",
177
+ "languages": "kotlin-objc",
178
+ "tools": [
179
+ "eslint",
180
+ "jest",
181
+ "lefthook",
182
+ "release-it",
183
+ "vite"
184
+ ],
185
+ "version": "0.63.1"
186
+ },
187
+ "allowScripts": {
188
+ "esbuild@0.28.2": true,
189
+ "lefthook@2.2.0": true
190
+ }
191
+ }
@@ -0,0 +1,18 @@
1
+ import type {TurboModule} from 'react-native';
2
+ import {TurboModuleRegistry} from 'react-native';
3
+
4
+ export interface Spec extends TurboModule {
5
+ getDefaultInstance(): void;
6
+ pushEvent(name: string, properties: Object): void;
7
+ onUserLogin(profile: Object): void;
8
+ pushProfile(profile: Object): void;
9
+ logout(): void;
10
+ setPushToken(token: string): void;
11
+ setLog(logLevel: string, enabled: boolean): void;
12
+ getNexoraId(): Promise<string>;
13
+ getProfileProperty(key: string): Promise<Object>;
14
+ setDeviceToken(token: string): void;
15
+ setFirebaseToken(token: string): void;
16
+ }
17
+
18
+ export default TurboModuleRegistry.getEnforcing<Spec>('Nexora');
package/src/index.ts ADDED
@@ -0,0 +1,59 @@
1
+ import Nexora from './NativeNexora';
2
+
3
+ export function getDefaultInstance(): void {
4
+ Nexora.getDefaultInstance();
5
+ }
6
+
7
+ export function pushEvent(name: string, properties: Record<string, any>): void {
8
+ Nexora.pushEvent(name, properties);
9
+ }
10
+
11
+ export function onUserLogin(profile: Record<string, any>): void {
12
+ Nexora.onUserLogin(profile);
13
+ }
14
+
15
+ export function pushProfile(profile: Record<string, any>): void {
16
+ Nexora.pushProfile(profile);
17
+ }
18
+
19
+ export function logout(): void {
20
+ Nexora.logout();
21
+ }
22
+
23
+ export function setPushToken(token: string): void {
24
+ Nexora.setPushToken(token);
25
+ }
26
+
27
+ export function setLog(logLevel: string, enabled: boolean): void {
28
+ Nexora.setLog(logLevel, enabled);
29
+ }
30
+
31
+ export function getNexoraId(): Promise<string> {
32
+ return Nexora.getNexoraId();
33
+ }
34
+
35
+ export function getProfileProperty(key: string): Promise<any> {
36
+ return Nexora.getProfileProperty(key);
37
+ }
38
+
39
+ export function setDeviceToken(token: string): void {
40
+ Nexora.setDeviceToken(token);
41
+ }
42
+
43
+ export function setFirebaseToken(token: string): void {
44
+ Nexora.setFirebaseToken(token);
45
+ }
46
+
47
+ export default {
48
+ getDefaultInstance,
49
+ pushEvent,
50
+ onUserLogin,
51
+ pushProfile,
52
+ logout,
53
+ setPushToken,
54
+ setLog,
55
+ getNexoraId,
56
+ getProfileProperty,
57
+ setDeviceToken,
58
+ setFirebaseToken
59
+ };