@weavr-io/secure-components-react-native
v5.1.0
Published
Secure components for embedding financial services into your app
Maintainers
Readme
@weavr-io/secure-components-react-native
@weavr-io/secure-components-react-native exposes Weavr's native mobile SDKs to React Native. It bundles a set of secure input components and helper methods that allow your application to authenticate users, enrol devices and handle KYC and challenge flows.
Features
- Secure text fields for passwords, passcodes and card details
- Helper methods for enrolment, biometric login and secure challenge flows
- Expo config plugin to automatically configure the underlying Android and iOS SDKs
Installation
npm install @weavr-io/secure-components-react-native
# or
yarn add @weavr-io/secure-components-react-nativeFor iOS, run npx pod-install after installing the package.
Expo configuration
Add the plugin to your app.json or app.config.js and provide any optional configuration:
// app.config.js
module.exports = {
plugins: [
[
'@weavr-io/secure-components-react-native',
{
permissions: {
"photosPermission": "Allow $(PRODUCT_NAME) to access photos in your library to perform KYC",
"cameraPermission": "Allow $(PRODUCT_NAME) to open the camera to perform KYC",
"microphonePermission": "Allow $(PRODUCT_NAME) to use the microphone to perform KYC",
"locationWhenInUseUsage": "Allow $(PRODUCT_NAME) to get access to your location while in use to perform KYC",
"faceIdUsage": "Allow $(PRODUCT_NAME) to get access to Face ID to login with biometrics"
},
// Android and iOS configuration options are reserved for
// internal use and should be omitted.
},
],
],
};The permissions options are optional. Android and iOS parameters are managed internally by Weavr and should not be set.
Usage
Initialise the Weavr components once on app start. The function accepts the target environment and your UI key:
import { initializeUXComponents, ENV } from '@weavr-io/secure-components-react-native';
// ENV can be 'Production', 'Sandbox' or 'QA'
initializeUXComponents('Sandbox', '<UI_KEY>');initializeUXComponents takes two arguments:
- env – one of
'Production','Sandbox'or'QA'. - uiKey – your Weavr UI key string.
The function returns a promise that resolves once the SDK has been initialised.
More information on the usage of the SDK can be found in our docs.
License
MIT
