![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@biopassid/signature-sdk-react-native
Advanced tools
BioPass ID Signature SDK React Native module.
Quick Start Guide • Prerequisites • Installation • How to use • LicenseKey • SignatureConfig • Something else • Changelog • Support
Check out our official documentation for more in depth information on BioPass ID.
Android | iOS | |
---|---|---|
Support | SDK 23+ | iOS 15+ |
- License key
- Internet connection is required to verify the license
npm install @biopassid/signature-sdk-react-native
Change the minimum Android sdk version to 23 (or higher) in your android/app/build.gradle
file.
minSdkVersion 23
Requires iOS 15.0 or higher.
Then go into your project's ios folder and run pod install.
# Go into ios folder
$ cd ios
# Install dependencies
$ pod install
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeOtherUserContent</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
<dict>
<key>NSPrivacyCollectedDataType</key>
<string>NSPrivacyCollectedDataTypeDeviceID</string>
<key>NSPrivacyCollectedDataTypeLinked</key>
<false/>
<key>NSPrivacyCollectedDataTypeTracking</key>
<false/>
<key>NSPrivacyCollectedDataTypePurposes</key>
<array>
<string>NSPrivacyCollectedDataTypePurposeAppFunctionality</string>
</array>
</dict>
</array>
<key>NSPrivacyTracking</key>
<false/>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
</dict>
</array>
</dict>
</plist>
To call Signature in your React Native project is as easy as follow:
import React from "react";
import { StyleSheet, View, Button } from "react-native";
import { useSignature } from "@biopassid/signature-sdk-react-native";
export default function App() {
const { takeSignature } = useSignature();
async function handleButton() {
const signature = await takeSignature({
licenseKey: "your-license-key",
});
console.log("Signature: ", signature.substring(0, 20));
}
return (
<View style={styles.container}>
<Button onPress={handleButton} title="Open Signature" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
backgroundColor: "#FFFFFF",
},
});
To use Signature Capture you need a license key. To set the license key needed is simple as setting another attribute. Simply doing:
const signature = await takeSignature({
licenseKey: "your-license-key",
});
You can also use pre-build configurations on your application, so you can automatically start using multiples features that better suit your application. You can instantiate each one and use it's default properties, or if you prefer you can change every config available. Here are the types that are supported right now:
Name | Type |
---|---|
licenseKey | string |
screenOrientation // Android only | SignatureScreenOrientation |
pencilColor | string |
pencilWidth | number |
backgroundColor | string |
overlayColor | string |
fontFamily | string |
titleText | SignatureTextOptions |
backButton | SignatureButtonOptions |
saveButton | SignatureButtonOptions |
deleteButton | SignatureButtonOptions |
undoButton | SignatureButtonOptions |
Default configs:
const defaultConfig: SignatureConfig = {
licenseKey: "",
screenOrientation: SignatureScreenOrientation.PORTRAIT, // Android only
pencilColor: "#000000",
pencilWidth: 5,
backgroundColor: "#FFFFFF",
overlayColor: "#80000000",
fontFamily: "signaturesdk_opensans_bold",
titleText: {
enabled: true,
content: "Captura de assinatura digital",
textColor: "#FFFFFF",
textSize: 20,
},
backButton: {
enabled: true,
backgroundColor: "#00000000",
buttonPadding: 0,
buttonSize: { width: 56, height: 56 },
iconOptions: {
enabled: true,
iconFile: "signaturesdk_ic_close",
iconColor: "#FFFFFF",
iconSize: { width: 32, height: 32 },
},
labelOptions: {
enabled: false,
content: "Voltar",
textColor: "#323232",
textSize: 14,
},
},
saveButton: {
enabled: true,
backgroundColor: "#FFFFFF",
buttonPadding: 0,
buttonSize: { width: 56, height: 56 },
iconOptions: {
enabled: true,
iconFile: "signaturesdk_ic_save",
iconColor: "#323232",
iconSize: { width: 32, height: 32 },
},
labelOptions: {
enabled: false,
content: "Salvar",
textColor: "#323232",
textSize: 14,
},
},
deleteButton: {
enabled: true,
backgroundColor: "#FFFFFF",
buttonPadding: 0,
buttonSize: { width: 56, height: 56 },
iconOptions: {
enabled: true,
iconFile: "signaturesdk_ic_delete",
iconColor: "#323232",
iconSize: { width: 32, height: 32 },
},
labelOptions: {
enabled: false,
content: "Deletar",
textColor: "#323232",
textSize: 14,
},
},
undoButton: {
enabled: true,
backgroundColor: "#FFFFFF",
buttonPadding: 0,
buttonSize: { width: 56, height: 56 },
iconOptions: {
enabled: true,
iconFile: "signaturesdk_ic_undo",
iconColor: "#323232",
iconSize: { width: 32, height: 32 },
},
labelOptions: {
enabled: false,
content: "Desfazer",
textColor: "#323232",
textSize: 14,
},
},
};
Name | Type |
---|---|
enabled | boolean |
backgroundColor | string |
buttonPadding | number |
buttonSize | SignatureSize |
iconOptions | SignatureIconOptions |
labelOptions | SignatureTextOptions |
Name | Type |
---|---|
enabled | boolean |
iconFile | string |
iconColor | string |
iconSize | SignatureSize |
Name | Type |
---|---|
enabled | boolean |
content | string |
textColor | string |
textSize | number |
Name | Type |
---|---|
width | number |
height | number |
Name |
---|
SignatureScreenOrientation.PORTRAIT |
SignatureScreenOrientation.LANDSCAPE |
You can use the default font family or set one of your own. To set a font, create a folder font under res directory in your android/app/src/main/res
. Download the font which ever you want and paste it inside font folder. All font file names must be only: lowercase a-z, 0-9, or underscore. The structure should be some thing like below.
To add the font files to your Xcode project:
Then, add the "Fonts provided by application" key to your app’s Info.plist file. For the key’s value, provide an array of strings containing the relative paths to any added font files.
In the following example, the font file is inside the fonts directory, so you use fonts/roboto_mono_bold_italic.ttf as the string value in the Info.plist file.
Finally, just set the font passing the name of the font file when instantiating SignatureConfig in your React Native app.
const signature = await takeSignature({
licenseKey: "your-license-key",
fontFamily: "roboto_mono_bold_italic",
});
You can use the default icons or define one of your own. To set a icon, download the icon which ever you want and paste it inside drawable folder in your android/app/src/main/res
. All icon file names must be only: lowercase a-z, 0-9, or underscore. The structure should be some thing like below.
To add icon files to your Xcode project:
Finally, just set the icon passing the name of the icon file when instantiating SignatureConfig in your React Native app.
const signature = await takeSignature({
licenseKey: "your-license-key",
// Changing back button icon
backButton: { iconOptions: { iconFile: "ic_baseline_camera" } },
// Changing save button icon
saveButton: { iconOptions: { iconFile: "ic_baseline_camera" } },
// Changing delete button icon
deleteButton: { iconOptions: { iconFile: "ic_baseline_camera" } },
// Changing undo button icon
undoButton: { iconOptions: { iconFile: "ic_baseline_camera" } },
});
Do you like the Signature SDK and would you like to know about our other products? We have solutions for face and fingerprint detection.
FAQs
BioPass ID Signature SDK React Native module.
The npm package @biopassid/signature-sdk-react-native receives a total of 5 weekly downloads. As such, @biopassid/signature-sdk-react-native popularity was classified as not popular.
We found that @biopassid/signature-sdk-react-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.