{"id":45770186,"url":"https://github.com/verloop/react-native-sdk","last_synced_at":"2026-02-26T05:02:48.108Z","repository":{"id":37361315,"uuid":"225304817","full_name":"verloop/react-native-sdk","owner":"verloop","description":"This is a wrapper over Android and iOS SDK for react native.","archived":false,"fork":false,"pushed_at":"2025-11-07T13:11:55.000Z","size":140940,"stargazers_count":0,"open_issues_count":21,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-11-07T14:35:01.688Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/verloop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-12-02T06:47:18.000Z","updated_at":"2025-11-07T13:10:24.000Z","dependencies_parsed_at":"2025-08-08T07:17:31.578Z","dependency_job_id":"c4f38bf7-03b2-486c-97cf-be17fa4f351d","html_url":"https://github.com/verloop/react-native-sdk","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/verloop/react-native-sdk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verloop%2Freact-native-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verloop%2Freact-native-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verloop%2Freact-native-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verloop%2Freact-native-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/verloop","download_url":"https://codeload.github.com/verloop/react-native-sdk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/verloop%2Freact-native-sdk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29849209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T22:37:40.667Z","status":"online","status_checked_at":"2026-02-26T02:00:06.774Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-26T05:02:47.487Z","updated_at":"2026-02-26T05:02:48.101Z","avatar_url":"https://github.com/verloop.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Getting started\n\n\u003e **Important Notes**: \n\u003e - This SDK version supports React Native \u003e= 0.70.0. For older React Native versions (\u003c 0.70.0), please use our previous package versions.\n\u003e - For Expo users: This SDK requires native modules and won't work with Expo Go. You must use Development Build.\n\n### Installation\n\n#### For Expo projects:\n1. Install the package:\n\n`$ npm install react-native-verloop-sdk --save`\n\n### Manual Installation (React Native \u003e= 0.70)\n\nThe package is automatically linked when building the app. No additional installation steps are required.\n\n### Mostly automatic installation (React Native \u003c 0.70)\n\nFor React Native versions below 0.70, please use our older package versions and follow the legacy installation steps:\n\n`$ react-native link react-native-verloop-sdk`\n\n### If you are using proguard in android add the following (React Native \u003c 0.70)\n\n```\n-keepattributes *Annotation*\n-keepclassmembers class ** {\n    @org.greenrobot.eventbus.Subscribe \u003cmethods\u003e;\n}\n-keep enum org.greenrobot.eventbus.ThreadMode { *; }\n```\n\n### Pods installation\n\n#### iOS\n\n1. Navigate to Your iOS Directory:\n   Open a terminal and navigate to the ios directory of your React Native project:\n   `cd ios`\n2. Edit Your Podfile:\n   Open the generated Podfile in your favorite text editor and add the necessary ,uncomment platform set like below :\n   `platform :ios, '13.0'`\n3. Install Pods:\n   `pod install`\n\n   Updating Pods : (if needed)\n   `cd ios`\n   `pod install --repo-update`\n\n\n#### Android (React Native \u003c 0.70)\n\n1. Open up `android/app/src/main/java/[...]/MainApplication.java`\n  - Add `import com.reactlibrary.VerloopSdkPackage;` to the imports at the top of the file\n  - Add `new VerloopSdkPackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-verloop-sdk'\n  \tproject(':react-native-verloop-sdk').projectDir = new File(rootProject.projectDir, \t'../node_modules/react-native-verloop-sdk/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      compile project(':react-native-verloop-sdk')\n  \t```\n\n## Usage\n```javascript\n  useEffect(() =\u003e {\n    const clientId = 'reactnative'; // Replace with your actual client ID\n    // Initialize Verloop SDK\n    VerloopSdk.createAnonymousUserConfig(clientId);\n    // Set up event emitter with the raw native module\n    const eventEmitter = new NativeEventEmitter(VerloopSdk);\n\n    // Add listeners\n    const buttonClickListener = eventEmitter.addListener(\n      'veloop_button_clicked',\n      event =\u003e {\n        console.log('Button clicked event:', event);\n        // To dismiss the chat (if required) [dismissChat- hides the widget and removes it from the view]\n        // VerloopSdk.dismissChat();\n      },\n    );\n    const urlClickListener = eventEmitter.addListener(\n      'veloop_url_clicked',\n      event =\u003e {\n        console.log('URL clicked event:', event);\n      },\n    );\n\n    VerloopSdk.putCustomField('test1', 'value');\n    VerloopSdk.putCustomFieldWithScope('test2', 'value', 'USER');\n    VerloopSdk.setUserEmail('user@example.com');\n    VerloopSdk.setUserPhone('1234567890');\n    VerloopSdk.setUserName('Test User');\n\n    // Enable listeners and show chat\n    VerloopSdk.setButtonClickListener();\n    VerloopSdk.setUrlClickListener();\n\n    return () =\u003e {\n      buttonClickListener.remove();\n      urlClickListener.remove();\n    };\n  }, []);\n```\n\n### Steps to enable notification:\n\nCreate your application on firebase console. (https://console.firebase.google.com)\n\nDownload google-services.json and GoogleService-Info.plist for android and iOS respectively.\\\nMake sure your google-services.json and GoogleService-Info.plist are placed in correct folders.\\\ngoogle-services.json is placed inside \u003cYOUR-PROJECT\u003e/android/app\\\nGoogleService-Info.plist is placed inside \u003cYOUR-PROJECT\u003e/ios\n  \n#### Android\nConfigure gradle files. https://firebase.google.com/docs/cloud-messaging/android/client#set-up-firebase-and-the-fcm-sdk\n\nAdd dependency:\n`implementation 'com.google.firebase:firebase-messaging:20.0.1'`\n\nEdit MainApplication.java:\n```java\nimport io.invertase.firebase.RNFirebasePackage;\nimport io.invertase.firebase.messaging.RNFirebaseMessagingPackage;                       \nimport io.invertase.firebase.notifications.RNFirebaseNotificationsPackage;\n@Override\nprotected List\u003cReactPackage\u003e getPackages() {\n  return Arrays.\u003cReactPackage\u003easList(\n   new MainReactPackage(),\n   new RNFirebasePackage(),\n   new RNFirebaseMessagingPackage(),\n   new RNFirebaseNotificationsPackage()\n  );                               \n}\n```\n\nAdd these lines in settings.gradle\n```gradle\ninclude ':react-native-firebase'                       \nproject(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')\n```\nIn app build gradle, add dependency:\n```gradle\ndependencies {\n   compile(project(':react-native-firebase')) {   \n       transitive = false\n   }\n   // ... other dependencies listed\n}\n```\n\nInstall firebase as a dependency\\\n`npm install --save react-native-firebase`\n\n#### React Native Code\n```typescript\nimport React, {Component} from 'react';\nimport VerloopSdk from 'react-native-verloop-sdk';\nimport firebase from 'react-native-firebase';\nimport { AsyncStorage } from 'react-native';\n\nexport default class VerloopLiveChat extends Component {\n\n    async componentDidMount() {\n        const token = await checkPermissionAndGetToken();\n        if(token != null){\n          await VerloopSdk.setFcmToken(token);\n        }\n          \n        await VerloopSdk.createAnonymousUserConfig('hello.stage');\n        VerloopSdk.showChat();\n    }\n   \n    async checkPermissionAndGetToken() {\n      const enabled = await firebase.messaging().hasPermission();\n      if (enabled) {\n          return this.getToken();\n      } else {\n          const permissionGranted = this.requestPermission();\n          if(permissionGranted){\n            return this.getToken();\n          }\n      }\n      return null;\n    }\n    \n    async getToken() {\n      let fcmToken = await AsyncStorage.getItem('fcmToken');\n      if (!fcmToken) {\n          fcmToken = await firebase.messaging().getToken();\n          if (fcmToken) {\n              // user has a device token\n              await AsyncStorage.setItem('fcmToken', fcmToken);\n          }\n      }\n      return fcmToken;\n    }\n\n    async requestPermission() {\n      try {\n          await firebase.messaging().requestPermission();\n          return true;\n      } catch (error) {\n          // User has rejected permissions\n          console.log('permission rejected');\n      }\n      return false;\n    }\n\n    render() {\n        return null;\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverloop%2Freact-native-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverloop%2Freact-native-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverloop%2Freact-native-sdk/lists"}