Config plugin to auto-configure rn-socure-sdk
when the native code is generated (expo prebuild
).
Tested against Expo SDK 46
This package cannot be used in the "Expo Go" app because it requires custom native code. First install the package with yarn, npm, or
expo install
.
** For now, manually add the following to package.json **
"@sparklaboratory/socure-sdk-expo-config-plugin": "git+ssh://[email protected]:thesparklaboratory/socure-sdk-expo-config-plugin.git",
"rn-socure-sdk": "git+ssh://[email protected]:thesparklaboratory/socure-docv-wrapper-react-native.git"
After installing this npm package, add the config plugin to the plugins
array of your app.json
or app.config.js
:
{
"expo": {
"android": {
"permissions": [
"CAMERA"
]
},
"ios": {
"infoPlist": {
"NSCameraUsageDescription": "This app uses the camera to verify your identity."
}
},
"plugins": ["@thesparklaboratory/socure-sdk-expo-config-plugin", {
"publicKey": "YOUR_PUBLIC_KEY"
}]
}
}
Install cocoapods user defined build types:
sudo gem install cocoapods-user-defined-build-types
Next, rebuild your app as described in the "Adding custom native code" guide.
The plugin provides props for extra customization. Every time you change the props or plugins, you'll need to rebuild (and prebuild
) the native app. If no extra properties are added, defaults will be used.
publicKey
(string): Public key for accessing socure docv sdk.authToken
(string): Socure references this in their RN wrapper.username
(string): Socure references this in their RN wrapper.
{
"expo": {
"android": {
"permissions": [
"CAMERA"
]
},
"ios": {
"infoPlist": {
"NSCameraUsageDescription": "This app uses the camera to verify your identity."
}
},
"plugins": [
[
"@sparklaboratory/socure-sdk-expo-config-plugin",
{
"publicKey": "YOUR_PUBLIC_KEY_HERE",
"authToken": "referenced in the socure docs, maybe not needed",
"username": "referenced in the socure docs, maybe not needed",
}
]
]
}
}