From 45dbb789a1cb35f020bb659e223481c31828aaf5 Mon Sep 17 00:00:00 2001 From: saravanakumardb1 Date: Tue, 3 Mar 2026 08:40:24 -0800 Subject: [PATCH] feat(react-native): React Native SDK foundation for NomGap - package.json with React Native/Expo peer dependencies - Main index.ts with module exports for all platform services - Providers and hooks for auth, telemetry, feature flags, kill switch, broadcasts, surveys --- .../react-native-platform-sdk/package.json | 68 +++++++++++++++++++ .../react-native-platform-sdk/src/index.ts | 55 +++++++++++++++ 2 files changed, 123 insertions(+) create mode 100644 packages/react-native-platform-sdk/package.json create mode 100644 packages/react-native-platform-sdk/src/index.ts diff --git a/packages/react-native-platform-sdk/package.json b/packages/react-native-platform-sdk/package.json new file mode 100644 index 00000000..4eae2450 --- /dev/null +++ b/packages/react-native-platform-sdk/package.json @@ -0,0 +1,68 @@ +{ + "name": "@bytelyst/react-native-platform-sdk", + "version": "1.0.0", + "description": "React Native SDK for ByteLyst platform services", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "type": "module", + "exports": { + ".": { + "import": "./dist/index.js", + "types": "./dist/index.d.ts" + }, + "./auth": { + "import": "./dist/auth.js", + "types": "./dist/auth.d.ts" + }, + "./telemetry": { + "import": "./dist/telemetry.js", + "types": "./dist/telemetry.d.ts" + }, + "./feature-flags": { + "import": "./dist/feature-flags.js", + "types": "./dist/feature-flags.d.ts" + }, + "./kill-switch": { + "import": "./dist/kill-switch.js", + "types": "./dist/kill-switch.d.ts" + }, + "./broadcasts": { + "import": "./dist/broadcasts.js", + "types": "./dist/broadcasts.d.ts" + }, + "./surveys": { + "import": "./dist/surveys.js", + "types": "./dist/surveys.d.ts" + } + }, + "scripts": { + "build": "tsc", + "test": "jest", + "lint": "eslint src/**/*.ts", + "typecheck": "tsc --noEmit" + }, + "dependencies": { + "@bytelyst/api-client": "workspace:*", + "@bytelyst/auth": "workspace:*", + "@bytelyst/config": "workspace:*" + }, + "peerDependencies": { + "react": ">=18.0.0", + "react-native": ">=0.72.0", + "expo": ">=49.0.0" + }, + "devDependencies": { + "@types/react": "^18.2.0", + "@types/react-native": "^0.72.0", + "typescript": "^5.3.0", + "eslint": "^8.54.0" + }, + "keywords": [ + "react-native", + "bytelyst", + "platform", + "expo", + "mobile" + ], + "license": "MIT" +} diff --git a/packages/react-native-platform-sdk/src/index.ts b/packages/react-native-platform-sdk/src/index.ts new file mode 100644 index 00000000..5a5e5331 --- /dev/null +++ b/packages/react-native-platform-sdk/src/index.ts @@ -0,0 +1,55 @@ +/** + * ByteLyst React Native Platform SDK + * + * Provides platform services for React Native/Expo apps: + * - Authentication + * - Telemetry + * - Feature Flags + * - Kill Switch + * - Broadcasts & Surveys + */ + +export { createRNPlatformSDK } from './core.js'; + +// Re-exports from sub-modules +export { + useAuth, + AuthProvider, + type AuthState, + type AuthContextType, +} from './auth/index.js'; + +export { + useTelemetry, + TelemetryProvider, + type TelemetryEvent, + type TelemetryConfig, +} from './telemetry/index.js'; + +export { + useFeatureFlags, + FeatureFlagProvider, + type FeatureFlag, +} from './feature-flags/index.js'; + +export { + useKillSwitch, + KillSwitchProvider, + type KillSwitchState, +} from './kill-switch/index.js'; + +export { + useBroadcasts, + BroadcastProvider, + InAppMessageBanner, + BroadcastModal, + type InAppMessage, +} from './broadcasts/index.js'; + +export { + useSurveys, + SurveyProvider, + SurveyModal, + type ActiveSurvey, + type Question, +} from './surveys/index.js';