capacitor-signply-sdk
v5.0.1
Published
A capacitor plugin to work with SIGNply SDK. Sign digital documents easily.
Maintainers
Readme
capacitor-signply-sdk
A Capacitor plugin to work with SIGNply SDK. Sign digital documents easily.
Requirements
- Capacitor 7+
- Node.js 20+
- Android: minSdk 24, compileSdk 35
- iOS: deployment target 14.0, Xcode 16+
Install
npm install capacitor-signply-sdk
npx cap syncConsiderations Android
It is necessary to add maven jitpack url in android/build.gradle file inside allprojects repositories like this:
allprojects {
repositories {
google()
mavenCentral()
maven {
url "https://jitpack.io"
}
}
}After that, sometimes it is necessary to sync with gradle files.
Considerations iOS
The iOS SDK frameworks (SignplySDK.xcframework and SecurePDF.xcframework) are included in the plugin package. After installing, run:
cd ios/App
pod installAPI
signDocument(...)
signDocument(options: { signplySDKParams: string; }) => Promise<{ result: string; }>| Param | Type |
| ------------- | ------------------------------------------ |
| options | { signplySDKParams: string; } |
Returns: Promise<{ result: string; }>
License
The SDK needs a license to work, which in this case is included in the example project (example/src/js/capacitor-welcome.js), params.licenseB64. For production you will need to ask for a license by packageName.
This license is only valid for testing and should never be used in production.
Usage
import { SignplySDKParams, SignplySdkPlugin } from 'capacitor-signply-sdk';
try {
const params = new SignplySDKParams();
params.licenseB64 = "LS0...";
const { result } = await SignplySdkPlugin.signDocument({ signplySDKParams: JSON.stringify(params) });
alert(result);
} catch (error) {
alert(error);
}Data Model
SignplySDKParams
- licenseB64 (String): Base 64 SIGNply license
- fileProperties (SignplySDKFileProperties): Contains file information
- commonProperties (SignplySDKCommonProperties): Contains common information
- widget (SignplySDKWidget): Configurable signature widget
- tsp (SignplySDKTSP): TSP configurable
- extra (SignplySDKExtra): Extra functionality in configurable SDK
- certificate (SignplySDKCertificate): Configurable signing certificate
- prevDialog (SignplySDKPrevDialog): Optional dialog before signature
SignplySDKFileProperties
- documentPath (String): Name of the pdf to sign located on external applications folder (example: document.pdf)
- documentUris (String[]): Array of document URI paths for multidocument signing
- signedName (String): Signed document name. Default "signply_document.pdf". If the name already exists, (1), (2), (3) are concatenated
- isShareable (Bool): If true, shows a document share button
- password (String): Document password
- author (String): Signature author
- reason (String): Signature reason
- contact (String): Contact of the author or entity of the signature
- location (String): Location of the author or entity of the signature
If file does not exist, an example file is used as default
SignplySDKCommonProperties
- title (String): Toolbar title, if null the document name is displayed
- requestLocation (Bool): If true, ask the user for the location at the time of signing
- saveOnPrivateStorage (Bool): Save document on private storage. Default false
- renderDefaultIndexPage (Int): Page to render directly. Default 0
- captureSignatureButtonsTop (Bool): Place canvas buttons on top. Default false
- reference (String): External reference for grouping purposes. Default empty
- saveSignatureImage (Bool): Return a signature image URI. Default false
- signatureImageMaxWidth (Int): Max width of signature image in px. Default 320
- signatureImageMaxHeight (Int): Max height of signature image in px. Default 320
SignplySDKWidget
- widgetType (SignplySDKWidgetType): Type of widget positioning. Default Manual
- widgetFloatText (String): String to search within the document for widget placement. Case sensitive
- widgetFieldFieldName (String): Name of the pre-existing field for widget placement
- widgetManualRatio (Float): Widget width to height ratio. Default 2.5 (range 1-4)
- widgetFixedPage (Int): Page number for fixed positioning. Starts at 1
- widgetFixedX (Int): Horizontal offset from bottom left corner
- widgetFixedY (Int): Vertical offset from bottom left corner
- widgetFloatGapY (Int): Vertical offset from found text
- widgetFloatGapX (Int): Horizontal offset from found text
- widgetCustomText (SignplySDKWidgetCustomText[]): Multiline texts for the signature widget
- widgetWidth (Int): Widget width. Min 50, default 150
- widgetHeight (Int): Widget height. Min 50, default 75
- requestWidgetCustomText (Bool): Prompt user for custom text. Default false
- signOnAllPages (Bool): Sign on all pages. Default false
- invisibleSignature (Bool): Perform invisible signature. Default false
SignplySDKTSP
- tspActivate (Bool): Time stamp activation
- tspURL (String): TSP url
- tspUser (String): TSP user
- tspPassword (String): TSP password
SignplySDKExtra
- autoOpen (Bool): Display signature widget automatically on document open (viewLastPage must be false)
- viewLastPage (Bool): Require user to view last page before signing
- signatureColorHex (String): Hexadecimal signature color. Default "#000000"
- signatureThickness (Int): Signature thickness. Default 10 (range 1-50)
- showReject (Bool): Show reject document button
- fullScreen (Bool): Signature view as full screen. Default false
- captureSignatureTitle (String): Title text in signature box
- captureSignatureSubTitle (String): Subtitle text in signature box
- captureSignatureSubtitleHeightDp (Int): Height of subtitle in dp
- showCanvasSignatureBackground (Bool): Show background in fixed/float signature. Default false
- signatureMetadataMode (Bool): Enable signature metadata mode. Default false
SignplySDKCertificate
- signCertP12B64 (String): Base64 signing certificate
- signCertPassword (String): Signing certificate password
- encKeyB64 (String): Public key for encryption of biometric data in base64
- ltv (Bool): Long-term validation signature. If no signing certificate is specified, an internal one is used
- requestUserCertificate (Bool): Prompt user for certificate at runtime. Default false
- defaultAliasUserCertiticate (String): Default alias for user certificate
- handwrittenSignature (Bool): If false, performs transparent signature without biometry. Default true
SignplySDKPrevDialog
- isEnabled (Bool): Show dialog before signature. Default false
- title (String): Dialog title
- message (String): Dialog message
SignplySDKWidgetType
- Manual: User can move the signature freely
- Field: Positioning by signature field name
- Fixed: Fixed positioning with page number and coordinates. Requires widgetFixedPage, widgetWidth, widgetHeight, widgetFixedX and widgetFixedY
- Float: Floating positioning by text search. Requires widgetFloatText, widgetWidth, widgetHeight, widgetFloatGapX and widgetFloatGapY
SignplySDKWidgetCustomText
- fontSize (Int): Text size
- text (String): Text string
