@maren-sa/react-native-sanarkit 2.5.0 → 2.5.2

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.
@@ -0,0 +1,51 @@
1
+ ## ITCBooking
2
+ The ITCBooking module provides instant teleconsultation booking functionality with build in interface. It integrates with SanarKit services to enable Instant appointment booking and consultation features.
3
+
4
+ ### Installation
5
+ The module is included in the SanarKit SDK package. No additional installation is required.
6
+
7
+ #### Usage
8
+ ```typescript
9
+ import { ITCBooking } from 'sanarkit';
10
+
11
+ // In your component
12
+ <ITCBooking
13
+ enable={boolean}
14
+ onEndFlow={() => void}
15
+ />
16
+ ```
17
+
18
+ #### Parameters
19
+ - `enable` (Boolean): Controls whether consultation module is active.
20
+ - `onEndFlow` (Function): Callback triggered when ITCBooking module is closed on back button.
21
+
22
+ #### Example
23
+ ```typescript
24
+ import React, { useState } from 'react';
25
+ import { ITCBooking } from 'sanarkit';
26
+
27
+ const MyComponent = () => {
28
+ const [instantBooking, setInstantBooking] = useState(false);
29
+
30
+ return (
31
+ <ITCBooking
32
+ enable={instantBooking}
33
+ onEndFlow={() => setInstantBooking(false)}
34
+ />
35
+ );
36
+ };
37
+ ```
38
+
39
+ #### Integration with SanarKit
40
+ The ITCBooking module requires an active SanarKit session to function properly. It uses the SanarKit session.
41
+
42
+ #### Error Handling
43
+ - If SanarKit session is not available, the component will trigger `onEndFlow` callback.
44
+ - Console warnings are logged when SanarKit services are not connected.
45
+
46
+ #### Notes
47
+ - The component automatically handles navigation state changes.
48
+ - Comes with build in interface for booking.
49
+ - Chat consultation can be initiated from the booking interface post booking is done.
50
+
51
+ For a complete implementation example, check out our [Example Repository](../exampleapp).
package/docs/readme.md ADDED
@@ -0,0 +1,89 @@
1
+ # React Native SanarKit SDK — Installation Guide
2
+
3
+ ## 1. Install the SDK
4
+
5
+ SanarKit is distributed as the private scoped package **`@maren-sa/react-native-sanarkit`**.
6
+
7
+ ### Option A — npm registry (recommended)
8
+
9
+ This is the default channel. You need access to the `@maren-sa` scope (ask MarenTech for an npm auth token), then add it to your project's `.npmrc`:
10
+
11
+ ```ini
12
+ @maren-sa:registry=https://registry.npmjs.org/
13
+ //registry.npmjs.org/:_authToken=${NPM_TOKEN}
14
+ ```
15
+
16
+ Install:
17
+
18
+ ```sh
19
+ npm install @maren-sa/react-native-sanarkit
20
+ # or
21
+ yarn add @maren-sa/react-native-sanarkit
22
+ ```
23
+
24
+ ### Option B — GitHub URL (fallback)
25
+
26
+ If you can't use the registry, install the same build straight from the repo (requires GitHub access to the repo). The package name and import path are identical to Option A.
27
+
28
+ ```sh
29
+ npm install github:MarenTech/react-native-sanarkit
30
+ # pin to a release tag (recommended):
31
+ npm install github:MarenTech/react-native-sanarkit#v2.3.0
32
+ ```
33
+
34
+ ## 2. Install peer dependencies
35
+
36
+ SanarKit relies on several native peer dependencies (Agora, permissions, SVG, WebView, etc.). Instead of installing them by hand, run the bundled setup command from your **app root** — after step 1, so the package is already installed (the `sanarkit-setup` bin is provided by SanarKit itself):
37
+
38
+ ```sh
39
+ npx sanarkit-setup
40
+ ```
41
+
42
+ This command (shipped inside the package) will:
43
+
44
+ - Read SanarKit's declared `peerDependencies` (the authoritative list — always in sync with the installed version) and install any that are missing from your app, at the correct version ranges.
45
+ - Remove the deprecated `sanar-rtc` package if it's still present (Agora 3.x → 4.x migration).
46
+ - Run `cd ios && pod install` on macOS if anything changed.
47
+
48
+ It auto-detects whether your app uses **npm** or **yarn** from your lockfile. Re-run it any time you upgrade SanarKit to pick up new or changed peer dependencies.
49
+
50
+ > **Note:** Requires Node.js 16 or higher.
51
+
52
+ ## 3. Native permissions
53
+
54
+ SanarKit's video/consultation features need camera and microphone access — see the [main README](../README.md#installation) for the iOS `Info.plist` keys and Android `AndroidManifest.xml` permissions.
55
+
56
+ ## Troubleshooting
57
+
58
+ ### iOS Issues
59
+ 1. Clean the build folder:
60
+ ```sh
61
+ cd ios && rm -rf build/
62
+ ```
63
+ 2. Remove Pods:
64
+ ```sh
65
+ cd ios && rm -rf Pods && rm -rf Podfile.lock
66
+ ```
67
+ 3. Reinstall pods:
68
+ ```sh
69
+ cd ios && pod install
70
+ ```
71
+ 4. If issues persist, clear the Metro bundler cache:
72
+ ```sh
73
+ npm start --reset-cache
74
+ # or
75
+ yarn start --reset-cache
76
+ ```
77
+
78
+ ### Android Issues
79
+ 1. Clean the gradle build:
80
+ ```sh
81
+ cd android && ./gradlew clean
82
+ ```
83
+ 2. Rebuild the project in Android Studio.
84
+
85
+ ## Support
86
+ For any issues or questions, please contact MarenTech support or visit the [GitHub repository](https://github.com/MarenTech/react-native-sanarkit).
87
+
88
+ ## License
89
+ This project is licensed under the MIT License — see the LICENSE file for details.
@@ -0,0 +1,98 @@
1
+
2
+ ## SanarRTC Module Integration
3
+
4
+ #### Step 1: Remove Agora SDK integration
5
+ Assuming you have already integrated the SanarKit Version 1.0.7, you can proceed with the following steps to integrate the SanarRTC module.
6
+
7
+ Remove the existing Agora SDK integration from your project which was installed from SanarKit previous version.
8
+
9
+ ```
10
+ npm uninstall react-native-agora
11
+ ```
12
+
13
+ Update Pods after removing the Agora SDK integration.
14
+
15
+ ```
16
+ cd ios && pod install
17
+ cd ..
18
+ ```
19
+
20
+ Install the latest version of the SanarKit.
21
+
22
+ ```
23
+ npm install https://github.com/MarenTech/react-native-sanarkit.git#1.1.0
24
+ ```
25
+
26
+ #### Step 2: SanarKit SDK Dependencies update
27
+
28
+ Assuming you have already setup sanar config like mentioned here [SanarKit SDK dependencies installation](readme.md#sanarkit-sdk-dependencies-installation), you can proceed with the following steps to update the SanarKit SDK dependencies.
29
+
30
+ ```sh
31
+ npm run sanar:setup
32
+ # or using yarn
33
+ yarn sanar:setup
34
+ ```
35
+ The above process will update and install the dependencies of the SanarKit SDK, along with the required dependencies for the SanarRTC module, which is a customized Agora dependency for teleconsultation.
36
+
37
+ ```json
38
+ "sanar-rtc": "github:MarenTech/sanar-rtc",
39
+ ```
40
+
41
+ #### Note: Permission integration check for iOS
42
+
43
+ If you encounter any permission-related issues while using the SanarRTC component, ensure that you have properly configured the permissions in your iOS Podfile:
44
+
45
+ 1. Add the permissions setup script in your Podfile:
46
+ ```ruby
47
+ require_relative '../node_modules/react-native-permissions/scripts/setup'
48
+ ```
49
+
50
+ 2. Configure the required permissions:
51
+ ```ruby
52
+ setup_permissions([
53
+ 'Camera',
54
+ 'Microphone',
55
+ ])
56
+ ```
57
+
58
+ 3. Install pods after adding permissions:
59
+ ```sh
60
+ cd ios && pod install
61
+ cd ..
62
+ ```
63
+
64
+ For a complete reference implementation, check the example Podfile at: [exampleapp/ios/Podfile](https://github.com/MarenTech/react-native-sanarkit/blob/1.1.0/exampleapp/ios/Podfile)
65
+
66
+ ## Troubleshooting
67
+
68
+ ### iOS Issues
69
+ If you encounter any issues with iOS, try the following:
70
+ 1. Clean the build folder:
71
+ ```sh
72
+ cd ios && rm -rf build/
73
+ ```
74
+ 2. Remove Pods:
75
+ ```sh
76
+ cd ios && rm -rf Pods && rm -rf Podfile.lock
77
+ ```
78
+ 3. Reinstall pods:
79
+ ```sh
80
+ cd ios && pod install
81
+ ```
82
+ 4. If issues persist, try clearing the Metro bundler cache:
83
+ ```sh
84
+ npm start --reset-cache
85
+ # or
86
+ yarn start --reset-cache
87
+ ```
88
+
89
+ ### Android Issues
90
+ If you encounter any issues with Android, try the following:
91
+ 1. Clean the gradle build:
92
+ ```sh
93
+ cd android && ./gradlew clean
94
+ ```
95
+ 2. Rebuild the project in Android Studio
96
+
97
+ ## Support
98
+ For any issues or questions, please visit our [GitHub repository](https://github.com/MarenTech/react-native-sanarkit).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maren-sa/react-native-sanarkit",
3
- "version": "2.5.0",
3
+ "version": "2.5.2",
4
4
  "description": "SanarKit is a React Native library for integrating Sanar's services in your app.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -16,13 +16,14 @@
16
16
  },
17
17
  "files": [
18
18
  "lib",
19
+ "docs",
19
20
  "scripts/sanarkit-setup.js"
20
21
  ],
21
22
  "repository": {
22
23
  "type": "git",
23
24
  "url": "git+https://github.com/MarenTech/react-native-sanarkit.git"
24
25
  },
25
- "homepage": "https://github.com/MarenTech/react-native-sanarkit#readme",
26
+ "homepage": "https://github.com/MarenTech/react-native-sanarkit/blob/main/docs/readme.md",
26
27
  "bugs": {
27
28
  "url": "https://github.com/MarenTech/react-native-sanarkit/issues"
28
29
  },