Groovs React Native Embed library
This section focusses on integrating Groov widget using react native library as a low-code solution
What does integrating Groov widgets look like?
Eg: Integrating in native mobile applications (using Groovs React Native embed library)
The following diagram explains a high level setup and handshake between the interacting components across your app ecosystem and Groov's.

Groov widget setup and interaction pattern
To setup and use Groov widget in a native mobile application using react native library:
- Add the Widget code from Groovs npm-library as per the readme instructions:
Groovs npm react-native-embed library-
Adding dependency through npm. Navigate to the root directory of your React Native project. and run the following command:
$ npm install @wearegroov/react-native-embed --save
-
Import the library in your main app code base
-
Follow the sample implementation steps to initiate calls to the GroovWebView by passing the requisite parameters and optionally setting any custom widget styling (Groov has a default styling pre-set)
-
- Your app server will need a new web service endpoint implemented to relay
gWidgetId
(Groov Widget Token) using your existing auth mechanism. This step ensures the Groov Widget Id (or identifier) acts as a session binder to the logged in user to your app client. You will need thegWidgetId
to be passed to Groov in the next step- Your organization is expected to implement a web service to receive and process such requests. This step 2 is purely a communication between your app client and your app server.
- The URL of this web service will need to be specified and updated in the Widget Code parameter as per step 1.iii
- Your app server will need to make a POST request to Groov endpoint and relay the following:
gWidgetId
- this enables Groov to bind the widget session to the logged in user/merchantMerchantIdentifier
- this will need to be an identifier of the merchant user on your platform. This could be a lead id or userid - something that helps bind a reference of the merchant in your platform to a reference of the merchant on Groov's platform, so that we can always show contextual information to such merchant. Whilst GroovWidgetToken will refresh and change everytime an instance of the widgets regenerates (due to app session timeouts, logouts, etc), the MerchantIdentifier will stay the same for the Merchant- Authorise the call to Groov by sending the
x_api_key
(the api key) you have for your Groov organisation account. Refer x-api-keys for details.
- Once Groov has received the
gWidgetId
from your app server, Groov widget as part of the webview initialisation will use thegWidgetId
to kick start the journey within your app. These sessions appear as part of your application, making the process feel more seamless and really embedded.- all product interaction within the widget hereafter will be controlled by Groov with direct communication between the Groov widget and the Groov app server.
Any new sessions by the merchant user on your app client will regenerate a new gWidgetId via the handshakes as detailed in steps 2 and 4.
Updated 1 day ago