react-native-docusign 1.0.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +50 -0
- package/README.md +198 -71
- package/android/build.gradle +7 -7
- package/android/src/main/java/expo/modules/docusign/DocuSignError.kt +30 -10
- package/android/src/main/java/expo/modules/docusign/DocuSignFailure.kt +145 -0
- package/android/src/main/java/expo/modules/docusign/DocuSignManager.kt +435 -58
- package/android/src/main/java/expo/modules/docusign/DocuSignModule.kt +66 -42
- package/build/DocuSign.types.d.ts +39 -0
- package/build/DocuSign.types.d.ts.map +1 -1
- package/build/DocuSignError.d.ts +86 -0
- package/build/DocuSignError.d.ts.map +1 -0
- package/build/DocuSignError.js +210 -0
- package/build/DocuSignError.js.map +1 -0
- package/build/DocuSignModule.d.ts +25 -5
- package/build/DocuSignModule.d.ts.map +1 -1
- package/build/DocuSignModule.js.map +1 -1
- package/build/api.d.ts +39 -6
- package/build/api.d.ts.map +1 -1
- package/build/api.js +102 -18
- package/build/api.js.map +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/useDocuSignSigning.d.ts +2 -1
- package/build/useDocuSignSigning.d.ts.map +1 -1
- package/build/useDocuSignSigning.js +20 -6
- package/build/useDocuSignSigning.js.map +1 -1
- package/ios/DocuSignError.swift +45 -10
- package/ios/DocuSignFailure.swift +104 -0
- package/ios/DocuSignManager.swift +219 -98
- package/ios/DocuSignModule.swift +43 -37
- package/ios/ReactNativeDocuSign.podspec +1 -1
- package/package.json +12 -3
- package/plugin/build/index.js +21 -41
- package/plugin/build/index.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
Upgrading from 1.x: every failure now rejects with a `DocuSignError`. Check any code that branches on `error.code`, matches message text, handles `status: 'error'` from `presentCaptiveSigning*`, or reads `errorCode` in an `addSigningErrorListener` callback. Codes are the lowercase codes the README documents, on both platforms, where iOS previously emitted `ERR_`-prefixed variants and Android rejected most failures as `signing_failed`. The new Android `launchStrategy` is opt-in. Both native SDKs also move forward, see [Native SDKs](#native-sdks) for what that changes in your app.
|
|
6
|
+
|
|
7
|
+
### Native SDKs
|
|
8
|
+
|
|
9
|
+
- **Android**: DocuSign Android SDK 2.1.4 to 2.1.7, the version DocuSign's install guide documents. Its own dependencies moved to Glide 5.0.4, OkHttp 4.12.0, RxJava 3, Room 2.7.2 and kotlin-stdlib 2.2.10, and it no longer pulls in RxJava 2, slf4j or commons-codec. Gradle resolves these across the whole app, so an app on an older OkHttp or Room gets the newer one. Compiling the module against it needs Kotlin 2.1 or newer, which Expo SDK 55 already ships. The config plugin still strips the Glide class from `sdk-pdf`, now pinned to the 2.1.7 hash, so run `npx expo prebuild` after upgrading to fetch the new AAR.
|
|
10
|
+
- **iOS**: DocuSign iOS SDK 4.1.1 to 4.3.0. DocuSign 4.3.0 fixes a double JavaScript invocation that caused signing backend errors. The captive signing screen gains Print, Download and Download Separate PDFs menu options (added in DocuSign 4.2.0), and the SDK has no setup key to hide them. DocuSign also inserted a new error code in the middle of its `DSMErrorCode` enum, so for DocuSign's own errors from 1022 up, `native.code` is one higher than on 4.1.1. A project with a committed `Podfile.lock` needs `pod update DocuSign`, because `pod install` alone keeps the locked 4.1.1 and fails to resolve.
|
|
11
|
+
|
|
12
|
+
### Breaking changes
|
|
13
|
+
|
|
14
|
+
- Every failure from `initialize`, `loginWithAccessToken`, `presentCaptiveSigning` and `presentCaptiveSigningWithUrl` rejects with a `DocuSignError` on both platforms. It carries `code` (what failed), `reason` (why, set only from verifiable facts), `native` and `http` (the raw SDK error and any DocuSign response), and `toAttributes()`. Branch on `code` and `reason`, never on message text, which was rewritten to say what failed and what to check. See [docs/ERROR_HANDLING.md](docs/ERROR_HANDLING.md).
|
|
15
|
+
- `presentCaptiveSigning` and `presentCaptiveSigningWithUrl` never resolve with `status: 'error'`. iOS used it for SDK errors reported after the signing UI was on screen, while Android rejected the same failures. Both platforms now reject, so a resolve always means completed or cancelled. `'error'` stays in `SigningStatus` so existing `switch` statements compile.
|
|
16
|
+
- Rejection codes are the documented lowercase codes on both platforms. iOS emitted `ERR_`-prefixed codes that Expo derived from exception class names, and Android rejected most failures as `signing_failed`. Two caller mistakes that hid inside `signing_failed` now have their own codes: `signing_in_progress` and `invalid_signing_url`. A missing presenter on iOS, or a missing foreground Activity on Android, rejects with `presentation_failed`, and an iOS initialization failure rejects with `initialize_failed`.
|
|
17
|
+
- `addSigningErrorListener` receives a `DocuSignError` instead of `{ errorCode, errorMessage }`, and now receives every failure from those four functions exactly once, caller mistakes included. It no longer wraps the native `onSigningError` event, which stays available on `DocuSignModule`.
|
|
18
|
+
- `useDocuSignSigning` types `error` as `DocuSignError | null`.
|
|
19
|
+
- **Android**: one native `onSigningError` event per failure instead of two.
|
|
20
|
+
|
|
21
|
+
### New features
|
|
22
|
+
|
|
23
|
+
- `DocuSignError.reason` classifies a failure as `usage`, `network`, `auth`, `configuration`, `recipient` or `unknown`, so an app can show a message that fits and skip retries that cannot succeed. A login failure is checked against `/oauth/userinfo` with the same token, which separates an expired token (`auth`) from a valid token DocuSign still refuses (`configuration`).
|
|
24
|
+
- `DocuSignError.toAttributes()` returns flat, primitive attributes ready for Amplitude, New Relic, Sentry or any other tool.
|
|
25
|
+
- Messages and details are redacted before they reach app code: JWTs, `Bearer` credentials, URL query strings and token-like URL path segments are removed. The redaction is pattern-based, so `toAttributes()`, which carries no message text, is the safest thing to forward to third-party tools.
|
|
26
|
+
- **Android**: `initialize` failures carry the SDK exception's details instead of a message alone, and the underlying error is the root of the exception's cause chain, where the transport failure that explains a timeout actually sits.
|
|
27
|
+
- In development, a caller mistake also prints one console warning naming the fix, so a catch that shows a generic toast cannot hide it.
|
|
28
|
+
- **Android**: the SDK's own error code, the HTTP status of an SDK REST failure, and DocuSign's error body from the recipient-view request are kept. The module previously forwarded only the exception message, and the `signingUrl` strategy discarded the error body entirely when it fell back to `fetch`.
|
|
29
|
+
- New [error handling guide](docs/ERROR_HANDLING.md) covering translated copy, retries, reporting to Amplitude, New Relic and Sentry, and reading the results in production. Its examples live in `examples/error-handling` and are type-checked in CI.
|
|
30
|
+
- **Android**: Add `presentCaptiveSigningWithUrl` support. The URL flow now has iOS/Android parity and does not require `loginWithAccessToken`.
|
|
31
|
+
- **Android**: Add an opt-in `launchStrategy` on `presentCaptiveSigning`. `signingUrl` mints a recipient view and launches the SDK's URL overload, skipping the envelope download that runs on a size-derived read timeout floored at 15s and can leave the ceremony unopened on large envelopes. Falls back to `fetch` if the mint fails. Defaults to `fetch`, so upgrading changes nothing unless you opt in.
|
|
32
|
+
|
|
33
|
+
### Fixes
|
|
34
|
+
|
|
35
|
+
- Bump `adm-zip`, the Config Plugin's only runtime dependency, to 0.6.1. This clears GHSA-xcpc-8h2w-3j85 (high) and GHSA-vwc7-r8mq-g2x9 (moderate) from consumers' `npm audit`. Neither was reachable: the plugin never extracts to disk, and it only parses the AAR it downloaded after checking its SHA-256, or its own cached copy under `node_modules`.
|
|
36
|
+
- **Android**: the Config Plugin matches the maven repository URL exactly when deciding whether `android/build.gradle` already declares it, and ignores declarations inside `//` and `/* */` comments. The substring check it replaces skipped adding the repository when the URL appeared only in a comment or as the prefix of a longer URL. It was also the CodeQL `js/incomplete-url-substring-sanitization` alert.
|
|
37
|
+
- **Android**: the Config Plugin no longer adds a `flatDir` block to `android/build.gradle`, and no longer warns Kotlin Script projects to add one by hand. The module has referenced the stripped `sdk-pdf` AAR by file path since 1.0.4, so the block did nothing. On current Expo templates it was never added anyway, because its pattern could not match the nested `maven { ... }` entry inside `allprojects.repositories`.
|
|
38
|
+
- **iOS**: the module compiles without warnings under the Swift 6 compiler. Its exception classes restate the `@unchecked Sendable` conformance they inherit from Expo's `Exception`, and a `??` fallback on `DSMManager.defaultConfigurations()`, which never returns nil, is gone.
|
|
39
|
+
- **iOS**: the view controller to present from is looked up on the main thread. The lookup read `UIApplication.shared` on the background queue the JS call arrived on.
|
|
40
|
+
- **iOS**: a missing view controller settles the promise once. It previously completed the pending signing slot with a failure and also threw, rejecting the same call twice.
|
|
41
|
+
- **iOS**: `endSigningSession` no longer calls `DSMManager` off the main thread. Expo dispatches a synchronous `AsyncFunction` body on a serial background queue, so `clearAllWebCookies()` and `logout()` were reached off-main on every call, including the one `useDocuSignSigning`'s `reset()` makes between flows. The guard now lives in `clearWebCookiesAsync`, the only method touching `DSMManager` and `WKWebsiteDataStore` directly, so it covers every caller. Thanks to @virajpsimformsolutions for finding and fixing this.
|
|
42
|
+
- **iOS**: `reset()` no longer re-enters itself to reach the main thread. The hop sat below the block that cancels an in-flight signing promise, so the re-entrant pass ran that block twice and could cancel a session that claimed the slot in between.
|
|
43
|
+
- **iOS**: reject a blank or non-`https` `signingUrl` before presenting. `DSMEnvelopesManager.presentCaptiveSigning` validates nothing and presents unconditionally, so a malformed URL rendered an empty signing controller whose completion never fired and left the promise unsettled. `signingUrl` defaults to `""` when JS omits it, so this was reachable without a malformed URL at all. Brings iOS to parity with the Android guard below.
|
|
44
|
+
- **Android**: reject a blank or non-`https` `signingUrl` before launching. The SDK's URL overload validates nothing and calls `startActivity` unconditionally, so a malformed URL opened an empty signing activity and left the promise unsettled.
|
|
45
|
+
- **Android**: `presentCaptiveSigning` now clears `currentEnvelopeId` when the launch itself throws, matching the URL path.
|
|
46
|
+
|
|
47
|
+
## 1.0.5
|
|
48
|
+
|
|
49
|
+
### New features
|
|
50
|
+
|
|
51
|
+
- New `reset()` API on iOS and Android. Heavier counterpart to `endSigningSession`: resolves any in-flight signing promise as cancelled, wipes WebKit data on iOS (cookies, service workers, fetch cache, IndexedDB, etc.), calls `logout()`, removes notification observers, and flips the internal `isInitialized` flag to `false` so the next `initialize()` call re-runs the underlying SDK setup against a fresh state. Use it for hard resets (error recovery, switching DocuSign accounts, app-level logout). For routine per-flow teardown on the same auth, prefer `endSigningSession`, which keeps the SDK initialized and avoids the observer churn.
|
|
52
|
+
|
|
3
53
|
## 1.0.4
|
|
4
54
|
|
|
5
55
|
### Bug fixes
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://raw.githubusercontent.com/IronTony/react-native-docusign/main/docs/img/banner-dark.svg" alt="react-native-docusign" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
1
5
|
# react-native-docusign
|
|
2
6
|
|
|
3
7
|
[](https://www.npmjs.com/package/react-native-docusign)
|
|
@@ -11,16 +15,14 @@ React Native / Expo native module that wraps the official DocuSign iOS and Andro
|
|
|
11
15
|
|
|
12
16
|
Built on the Expo Modules API. Works with Expo SDK 55+ (managed or bare with `expo prebuild`) and Expo Dev Client. Also usable in non-Expo React Native projects after running [`npx install-expo-modules`](https://docs.expo.dev/bare/installing-expo-modules/) to install `expo-modules-core`; in that case, run `expo prebuild` so the Config Plugin can fetch the DocuSign sdk-pdf AAR and inject the iOS / Android build settings, otherwise you must replicate those steps by hand.
|
|
13
17
|
|
|
14
|
-
> **Unofficial package.** This is a community wrapper. It is not affiliated with or
|
|
18
|
+
> **Unofficial package.** This is a community wrapper. It is not affiliated with, endorsed by, or sponsored by DocuSign, Inc. or any other organization. "DocuSign" is a trademark of DocuSign, Inc. The MIT license covers this wrapper's source code only. Consumers are responsible for accepting DocuSign's Mobile SDK License Agreement separately when integrating with DocuSign's services.
|
|
15
19
|
|
|
16
20
|
## iOS ↔ Android parity
|
|
17
21
|
|
|
18
22
|
| Flow | iOS | Android |
|
|
19
23
|
|-------------------------------------------------------------------------|:---:|:-------:|
|
|
20
24
|
| Session flow: `initialize` → `loginWithAccessToken` → `presentCaptiveSigning` | ✅ | ✅ |
|
|
21
|
-
| URL flow: `presentCaptiveSigningWithUrl`
|
|
22
|
-
|
|
23
|
-
The DocuSign Android SDK (2.1.4) does not expose a public URL-based signing entry point; calling `presentCaptiveSigningWithUrl` on Android rejects with `not_implemented`. **Default to the session flow for cross-platform apps.**
|
|
25
|
+
| URL flow: `initialize` → `presentCaptiveSigningWithUrl` | ✅ | ✅ |
|
|
24
26
|
|
|
25
27
|
## One backend response, both platforms
|
|
26
28
|
|
|
@@ -49,6 +51,7 @@ Full schema and BFF reference implementation: [`docs/BACKEND_GUIDE.md` → Sessi
|
|
|
49
51
|
- [logout](#logout-promisevoid)
|
|
50
52
|
- [isLoggedIn](#isloggedin-promiseboolean)
|
|
51
53
|
- [endSigningSession](#endsigningsession-promisevoid)
|
|
54
|
+
- [reset](#reset-promisevoid)
|
|
52
55
|
- [Event listeners](#event-listeners)
|
|
53
56
|
- [Types](#types)
|
|
54
57
|
- [Authentication flow](#authentication-flow)
|
|
@@ -91,12 +94,12 @@ The React Native layer never renders any of the signing UI. It only triggers the
|
|
|
91
94
|
|
|
92
95
|
| Platform | Minimum OS | SDK version | Language |
|
|
93
96
|
| -------- | -------------------- | -------------------------- | ----------- |
|
|
94
|
-
| iOS | 15.1 | DocuSign iOS SDK 4.
|
|
95
|
-
| Android | API 24 (Android 7.0) | DocuSign Android SDK 2.1.
|
|
97
|
+
| iOS | 15.1 | DocuSign iOS SDK 4.3.0 | Swift 5.9 |
|
|
98
|
+
| Android | API 24 (Android 7.0) | DocuSign Android SDK 2.1.7 | Kotlin 2.1+ |
|
|
96
99
|
|
|
97
100
|
**Runtime requirements:**
|
|
98
101
|
|
|
99
|
-
- Expo SDK 55 or newer, OR bare React Native 0.74+
|
|
102
|
+
- Expo SDK 55 or newer, OR bare React Native 0.74+ (Android needs Kotlin 2.1 or newer)
|
|
100
103
|
- React Native New Architecture (Fabric + Hermes): supported, no additional configuration
|
|
101
104
|
- Expo Go: NOT supported (custom native modules require a development build)
|
|
102
105
|
|
|
@@ -104,12 +107,12 @@ The React Native layer never renders any of the signing UI. It only triggers the
|
|
|
104
107
|
|
|
105
108
|
The DocuSign native SDKs are **NOT bundled** inside this npm package. They are declared as external dependencies and resolved at consumer build time:
|
|
106
109
|
|
|
107
|
-
- **iOS**: `pod
|
|
108
|
-
- **Android**: `com.docusign:androidsdk:2.1.
|
|
110
|
+
- **iOS**: the `DocuSign` pod (`~> 4.3.0`) from the public CocoaPods trunk, declared by this package's podspec
|
|
111
|
+
- **Android**: `com.docusign:androidsdk:2.1.7` from DocuSign's Maven repository (the config plugin adds the repo automatically)
|
|
109
112
|
|
|
110
113
|
### Android Glide collision workaround
|
|
111
114
|
|
|
112
|
-
DocuSign's `com.docusign:sdk-pdf:2.1.
|
|
115
|
+
DocuSign's `com.docusign:sdk-pdf:2.1.7` AAR ships a pre-generated `com.bumptech.glide.GeneratedAppGlideModuleImpl.class` that collides at dex time with any other Glide-based library in the host app (notably `expo-image`, `react-native-fast-image`, and similar). To avoid this without redistributing DocuSign's binary, the Expo Config Plugin downloads `sdk-pdf-2.1.7.aar` directly from DocuSign's public Maven during `expo prebuild`, verifies its SHA-256 against a pinned hash, removes the offending class from the AAR's `classes.jar` in-memory, and writes the stripped artifact to `node_modules/react-native-docusign/android/libs/`. The module's `android/build.gradle` references it by file path at consumer build time. The download is cached after the first run; corrupted or partial caches are detected and regenerated. SHA mismatch or fetch failure aborts `expo prebuild` with an actionable error rather than silently letting the Android build fail later at the dex step.
|
|
113
116
|
|
|
114
117
|
### What ships inside this package
|
|
115
118
|
|
|
@@ -179,7 +182,7 @@ npx expo run:android
|
|
|
179
182
|
|
|
180
183
|
If you are not using Expo prebuild, you must manually:
|
|
181
184
|
|
|
182
|
-
- **iOS**:
|
|
185
|
+
- **iOS**: run `pod install`. This package's podspec already depends on the `DocuSign` pod, so your Podfile needs no entry for it
|
|
183
186
|
- **Android**: add the Maven repo and the DocuSign dependency to your `android/build.gradle` + `android/app/build.gradle`
|
|
184
187
|
- **iOS**: add the `NSCameraUsageDescription` and `NSPhotoLibraryUsageDescription` keys to your `Info.plist`
|
|
185
188
|
- **Android**: add the required permissions to your `AndroidManifest.xml`
|
|
@@ -206,7 +209,7 @@ type DocuSignPluginProps = {
|
|
|
206
209
|
|
|
207
210
|
/**
|
|
208
211
|
* URL of the Android Maven repository that serves the DocuSign Android SDK.
|
|
209
|
-
* Defaults to 'https://
|
|
212
|
+
* Defaults to 'https://docucdn-a.akamaihd.net/prod/docusignandroidsdk'.
|
|
210
213
|
* Override only if DocuSign moves their repo.
|
|
211
214
|
*/
|
|
212
215
|
androidMavenRepo?: string;
|
|
@@ -249,27 +252,30 @@ async function signAgreement() {
|
|
|
249
252
|
});
|
|
250
253
|
|
|
251
254
|
// Step 4: present the native signing UI
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
try {
|
|
256
|
+
const result = await DocuSign.presentCaptiveSigning({
|
|
257
|
+
envelopeId: session.envelopeId,
|
|
258
|
+
recipientUserName: session.userName,
|
|
259
|
+
recipientEmail: session.email,
|
|
260
|
+
recipientClientUserId: session.recipientClientUserId,
|
|
261
|
+
});
|
|
258
262
|
|
|
259
|
-
|
|
260
|
-
case 'completed':
|
|
263
|
+
if (result.status === 'completed') {
|
|
261
264
|
console.log('Signed:', result.envelopeId);
|
|
262
|
-
|
|
263
|
-
case 'cancelled':
|
|
265
|
+
} else {
|
|
264
266
|
console.log('User cancelled signing');
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
}
|
|
268
|
+
} catch (error) {
|
|
269
|
+
if (error instanceof DocuSign.DocuSignError) {
|
|
270
|
+
// error.reason picks the message to show, error.toAttributes() goes to your logs.
|
|
271
|
+
console.error(error.code, error.reason, error.message);
|
|
272
|
+
}
|
|
269
273
|
}
|
|
270
274
|
}
|
|
271
275
|
```
|
|
272
276
|
|
|
277
|
+
Every failure rejects with a `DocuSignError`. See [Error handling](#error-handling).
|
|
278
|
+
|
|
273
279
|
## API reference
|
|
274
280
|
|
|
275
281
|
### `initialize(config: DocuSignConfig): Promise<void>`
|
|
@@ -288,7 +294,7 @@ type DocuSignConfig = {
|
|
|
288
294
|
- `integratorKey`: your DocuSign Integrator Key (Client ID). Can be fetched from your backend at runtime to avoid shipping it in the app bundle.
|
|
289
295
|
- `environment`: `'demo'` targets `demo.docusign.net` (DocuSign developer sandbox). `'production'` targets `docusign.net`.
|
|
290
296
|
|
|
291
|
-
**Throws:**
|
|
297
|
+
**Throws:** a `DocuSignError` with `initialize_failed` if the SDK cannot be configured.
|
|
292
298
|
|
|
293
299
|
### `loginWithAccessToken(params: DocuSignAuthParams): Promise<void>`
|
|
294
300
|
|
|
@@ -314,7 +320,10 @@ type DocuSignAuthParams = {
|
|
|
314
320
|
- `email`: email address for the signer
|
|
315
321
|
- `host`: DocuSign API host URL (e.g. `'https://demo.docusign.net/restapi'`)
|
|
316
322
|
|
|
317
|
-
**Throws:**
|
|
323
|
+
**Throws:**
|
|
324
|
+
|
|
325
|
+
- `not_initialized` if `initialize` has not been called
|
|
326
|
+
- `login_failed` if DocuSign rejects the login. `reason` separates an expired or wrongly scoped token (`auth`) from a valid token DocuSign still refuses (`configuration`) and a lost connection (`network`). The package tells them apart by checking the same token against `/oauth/userinfo`.
|
|
318
327
|
|
|
319
328
|
**Notes:** access tokens from DocuSign are typically valid for 1 hour. Do not cache them client-side. Fetch a fresh token for each signing session.
|
|
320
329
|
|
|
@@ -328,13 +337,14 @@ type CaptiveSigningParams = {
|
|
|
328
337
|
recipientUserName: string;
|
|
329
338
|
recipientEmail: string;
|
|
330
339
|
recipientClientUserId: string;
|
|
340
|
+
launchStrategy?: 'fetch' | 'signingUrl'; // Android only, default 'fetch'
|
|
331
341
|
};
|
|
332
342
|
|
|
333
343
|
type SigningResult = {
|
|
334
|
-
status: 'completed' | 'cancelled' | 'error';
|
|
344
|
+
status: 'completed' | 'cancelled' | 'error'; // 'error' is never returned since 2.0.0
|
|
335
345
|
envelopeId: string;
|
|
336
346
|
errorCode?: string;
|
|
337
|
-
errorMessage?: string;
|
|
347
|
+
errorMessage?: string; // for 'cancelled', the SDK's exit reason when it gives one
|
|
338
348
|
};
|
|
339
349
|
```
|
|
340
350
|
|
|
@@ -343,14 +353,43 @@ type SigningResult = {
|
|
|
343
353
|
- `envelopeId`: the DocuSign envelope ID created by your backend
|
|
344
354
|
- `recipientUserName`, `recipientEmail`: must match the recipient registered on the envelope
|
|
345
355
|
- `recipientClientUserId`: the `clientUserId` of the embedded recipient, used by DocuSign to identify captive signers
|
|
356
|
+
- `launchStrategy`: how the Android SDK opens the ceremony, see [Android launch strategies](#android-launch-strategies). Ignored on iOS.
|
|
357
|
+
|
|
358
|
+
**Throws:** a `DocuSignError`.
|
|
346
359
|
|
|
347
|
-
|
|
360
|
+
- `not_initialized` if `initialize` has not been called
|
|
361
|
+
- `not_logged_in` if `loginWithAccessToken` has not been called
|
|
362
|
+
- `signing_in_progress` if a ceremony is already open
|
|
363
|
+
- `presentation_failed` if there is no screen to present from
|
|
364
|
+
- `signing_failed` if the ceremony cannot open or ends with an error. `reason` tells a lost connection (`network`), an expired token (`auth`) or a recipient that does not match the envelope (`recipient`) apart from an SDK error the package cannot classify (`unknown`).
|
|
348
365
|
|
|
349
366
|
**Returns:** resolves with a `SigningResult` once the user completes or cancels. `status === 'completed'` means the user finished the signing ceremony. `status === 'cancelled'` means the user explicitly cancelled or closed the signing UI.
|
|
350
367
|
|
|
368
|
+
#### Android launch strategies
|
|
369
|
+
|
|
370
|
+
The Android SDK can open a captive signing ceremony two ways, and `launchStrategy` picks between them. It has no effect on iOS.
|
|
371
|
+
|
|
372
|
+
`'fetch'` is the default and matches every release before this option existed. The SDK downloads the envelope with `include=documents` and then opens the ceremony. That download runs on a read timeout derived from the envelope size, which floors at 15 seconds when nothing is cached, so a large envelope on a slow connection can exhaust it and the ceremony never opens.
|
|
373
|
+
|
|
374
|
+
`'signingUrl'` skips the download. The module mints a recipient view with the session access token (`POST /accounts/{accountId}/envelopes/{envelopeId}/views/recipient`) and points the SDK straight at the returned URL, so the call that times out never runs.
|
|
375
|
+
|
|
376
|
+
```ts
|
|
377
|
+
await presentCaptiveSigning({
|
|
378
|
+
envelopeId,
|
|
379
|
+
recipientUserName,
|
|
380
|
+
recipientEmail,
|
|
381
|
+
recipientClientUserId,
|
|
382
|
+
launchStrategy: 'signingUrl',
|
|
383
|
+
});
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
Before opting in, check that the access token you pass to `loginWithAccessToken` is scoped to create recipient views on the envelope. If the mint fails the module falls back to `'fetch'`, so the worst case is a wasted round trip per ceremony rather than a failure, but there is no point paying for it if the token cannot mint.
|
|
387
|
+
|
|
388
|
+
If your backend already mints recipient view URLs, prefer `presentCaptiveSigningWithUrl` instead. It keeps the DocuSign access token off the device entirely, which is the better shape. `'signingUrl'` exists for teams who cannot change their backend.
|
|
389
|
+
|
|
351
390
|
### `presentCaptiveSigningWithUrl(params: CaptiveSigningUrlParams): Promise<SigningResult>`
|
|
352
391
|
|
|
353
|
-
|
|
392
|
+
Presents the DocuSign signing UI using a pre-minted recipient view URL (obtained server-side from `POST /envelopes/{id}/views/recipient`). Bypasses SDK authentication; `initialize` is required, but `loginWithAccessToken` is not.
|
|
354
393
|
|
|
355
394
|
```ts
|
|
356
395
|
type CaptiveSigningUrlParams = {
|
|
@@ -366,14 +405,17 @@ type CaptiveSigningUrlParams = {
|
|
|
366
405
|
- `envelopeId`: the DocuSign envelope ID
|
|
367
406
|
- `recipientId` (optional): identifier used for event correlation
|
|
368
407
|
|
|
369
|
-
**Throws:**
|
|
408
|
+
**Throws:** a `DocuSignError`.
|
|
370
409
|
|
|
371
|
-
- `
|
|
372
|
-
- `
|
|
410
|
+
- `not_initialized` if `initialize` has not been called
|
|
411
|
+
- `invalid_signing_url` if the URL is blank or not `https`
|
|
412
|
+
- `signing_in_progress` if a ceremony is already open
|
|
413
|
+
- `presentation_failed` if there is no screen to present from
|
|
414
|
+
- `signing_failed` if the URL is expired or rejected by DocuSign, with `reason` as for `presentCaptiveSigning`
|
|
373
415
|
|
|
374
416
|
**Returns:** same `SigningResult` shape as `presentCaptiveSigning`.
|
|
375
417
|
|
|
376
|
-
**Why this flow:** keeps the DocuSign access token out of the mobile app entirely; your backend mints the signing URL and hands that single-use credential to the client. Recommended for production iOS flows.
|
|
418
|
+
**Why this flow:** keeps the DocuSign access token out of the mobile app entirely; your backend mints the signing URL and hands that single-use credential to the client. Recommended for production iOS and Android flows.
|
|
377
419
|
|
|
378
420
|
### `logout(): Promise<void>`
|
|
379
421
|
|
|
@@ -391,6 +433,21 @@ Call this between captive signing flows (e.g. inside the `finally` block of your
|
|
|
391
433
|
|
|
392
434
|
The `useDocuSignSigning` hook's `reset()` calls this automatically when the SDK has been initialized.
|
|
393
435
|
|
|
436
|
+
### `reset(): Promise<void>`
|
|
437
|
+
|
|
438
|
+
Full SDK teardown. Heavier counterpart to `endSigningSession`: resolves any in-flight signing promise as cancelled, wipes WebKit data on iOS (cookies, service workers, fetch cache, IndexedDB, etc.), calls `logout()`, removes notification observers (iOS), and flips the internal `isInitialized` flag to `false` so the next `initialize()` call re-runs the underlying SDK setup against a fresh state.
|
|
439
|
+
|
|
440
|
+
Use this when you want a hard reset between flows (error recovery, switching DocuSign accounts, after an app-level logout). For routine teardown between consecutive captive signing flows on the same auth, prefer `endSigningSession`, which keeps the SDK initialized and skips the observer churn.
|
|
441
|
+
|
|
442
|
+
Safe to call when the SDK was never initialized: returns immediately without touching the underlying SDK.
|
|
443
|
+
|
|
444
|
+
| Use case | Recommended call |
|
|
445
|
+
| --- | --- |
|
|
446
|
+
| Between captive signing flows in the same app session | `endSigningSession` |
|
|
447
|
+
| After an error you want to recover from | `reset` |
|
|
448
|
+
| Switching DocuSign accounts / integrator keys | `reset` |
|
|
449
|
+
| App-level logout | `reset` |
|
|
450
|
+
|
|
394
451
|
### Event listeners
|
|
395
452
|
|
|
396
453
|
In addition to the promise-based API, you can subscribe to events. Events fire for every signing result, including those triggered from other parts of your app.
|
|
@@ -404,8 +461,9 @@ const cancelSub = DocuSign.addSigningCancelledListener((event) => {
|
|
|
404
461
|
console.log('Cancelled:', event.envelopeId, event.reason);
|
|
405
462
|
});
|
|
406
463
|
|
|
407
|
-
const errorSub = DocuSign.addSigningErrorListener((
|
|
408
|
-
|
|
464
|
+
const errorSub = DocuSign.addSigningErrorListener((error) => {
|
|
465
|
+
// Every DocuSignError, caller mistakes included, once each and before the call rejects.
|
|
466
|
+
analytics.track('docusign_failed', error.toAttributes());
|
|
409
467
|
});
|
|
410
468
|
|
|
411
469
|
// Later, clean up:
|
|
@@ -414,6 +472,8 @@ cancelSub.remove();
|
|
|
414
472
|
errorSub.remove();
|
|
415
473
|
```
|
|
416
474
|
|
|
475
|
+
`addSigningErrorListener` covers `initialize`, `loginWithAccessToken`, `presentCaptiveSigning` and `presentCaptiveSigningWithUrl`. Register it once at startup to send every failure to your analytics or error reporting tool, as shown in the [error handling guide](docs/ERROR_HANDLING.md#sending-errors-to-your-tools).
|
|
476
|
+
|
|
417
477
|
In React hooks:
|
|
418
478
|
|
|
419
479
|
```ts
|
|
@@ -466,7 +526,7 @@ function SigningScreen() {
|
|
|
466
526
|
{state === 'signing' && <Text>Opening signing UI...</Text>}
|
|
467
527
|
{state === 'completed' && <Text>Signed envelope {result?.envelopeId}</Text>}
|
|
468
528
|
{state === 'cancelled' && <Text>Signing cancelled</Text>}
|
|
469
|
-
{state === 'error' && <Text>
|
|
529
|
+
{state === 'error' && error && <Text>{t(DOCUSIGN_ERROR_COPY_KEY[error.reason])}</Text>}
|
|
470
530
|
</View>
|
|
471
531
|
);
|
|
472
532
|
}
|
|
@@ -477,12 +537,12 @@ function SigningScreen() {
|
|
|
477
537
|
- Calls `initialize()` automatically on mount (toggle with `autoInitialize: false` if you want to defer)
|
|
478
538
|
- Accepts both signing flows via a discriminated union on `startSigning(session)`:
|
|
479
539
|
- `{ type: 'session', ... }`: runs `loginWithAccessToken` + `presentCaptiveSigning` (iOS + Android)
|
|
480
|
-
- `{ type: 'url', ... }`: runs `presentCaptiveSigningWithUrl` (iOS
|
|
540
|
+
- `{ type: 'url', ... }`: runs `presentCaptiveSigningWithUrl` (iOS + Android, no SDK login)
|
|
481
541
|
- Tracks SDK state in a finite state machine
|
|
482
|
-
-
|
|
542
|
+
- Stores the latest `DocuSignError` in the `error` field. `DOCUSIGN_ERROR_COPY_KEY` in the usage example comes from the [error handling guide](docs/ERROR_HANDLING.md#copyts)
|
|
483
543
|
- Cleans up event listeners on unmount
|
|
484
544
|
|
|
485
|
-
### URL-flow example (iOS)
|
|
545
|
+
### URL-flow example (iOS + Android)
|
|
486
546
|
|
|
487
547
|
```tsx
|
|
488
548
|
const result = await startSigning({
|
|
@@ -551,7 +611,7 @@ type UseDocuSignSigningOptions = {
|
|
|
551
611
|
|
|
552
612
|
type UseDocuSignSigningReturn = {
|
|
553
613
|
state: DocuSignSigningState;
|
|
554
|
-
error:
|
|
614
|
+
error: DocuSignError | null;
|
|
555
615
|
result: SigningResult | null;
|
|
556
616
|
initialize: () => Promise<void>; // manual init if autoInitialize=false
|
|
557
617
|
startSigning: (session: SigningSession) => Promise<SigningResult>;
|
|
@@ -589,6 +649,7 @@ export type CaptiveSigningParams = {
|
|
|
589
649
|
recipientClientUserId: string;
|
|
590
650
|
};
|
|
591
651
|
|
|
652
|
+
// 'error' is never returned since 2.0.0. It stays so existing switch statements compile.
|
|
592
653
|
export type SigningStatus = 'completed' | 'cancelled' | 'error';
|
|
593
654
|
|
|
594
655
|
export type SigningResult = {
|
|
@@ -607,13 +668,37 @@ export type SigningCancelledEvent = {
|
|
|
607
668
|
reason?: string;
|
|
608
669
|
};
|
|
609
670
|
|
|
610
|
-
export
|
|
671
|
+
export class DocuSignError extends Error {
|
|
672
|
+
code: DocuSignErrorCode;
|
|
673
|
+
reason: DocuSignErrorReason;
|
|
611
674
|
envelopeId?: string;
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
675
|
+
native?: DocuSignNativeErrorDetails;
|
|
676
|
+
http?: DocuSignHttpErrorDetails;
|
|
677
|
+
toAttributes(): DocuSignErrorAttributes;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
export type DocuSignErrorCode =
|
|
681
|
+
| 'not_initialized'
|
|
682
|
+
| 'not_logged_in'
|
|
683
|
+
| 'signing_in_progress'
|
|
684
|
+
| 'invalid_signing_url'
|
|
685
|
+
| 'presentation_failed'
|
|
686
|
+
| 'initialize_failed'
|
|
687
|
+
| 'login_failed'
|
|
688
|
+
| 'signing_failed'
|
|
689
|
+
| 'unexpected';
|
|
690
|
+
|
|
691
|
+
export type DocuSignErrorReason =
|
|
692
|
+
| 'usage'
|
|
693
|
+
| 'network'
|
|
694
|
+
| 'auth'
|
|
695
|
+
| 'configuration'
|
|
696
|
+
| 'recipient'
|
|
697
|
+
| 'unknown';
|
|
615
698
|
```
|
|
616
699
|
|
|
700
|
+
The full error model, including `native`, `http` and the attributes, is in the [error handling guide](docs/ERROR_HANDLING.md#the-error-model).
|
|
701
|
+
|
|
617
702
|
## Authentication flow
|
|
618
703
|
|
|
619
704
|
This package does NOT implement DocuSign JWT Grant authentication. JWT Grant must happen on your backend because it requires access to an RSA private key that should never ship on mobile devices.
|
|
@@ -687,7 +772,9 @@ const envelope = await docusign.envelopes.create({
|
|
|
687
772
|
|
|
688
773
|
## Multi-document / multi-envelope chaining
|
|
689
774
|
|
|
690
|
-
Because the DocuSign SDK returns control to your app after each signing ceremony, you can
|
|
775
|
+
Because the DocuSign SDK returns control to your app after each signing ceremony, you can chain multiple signings in sequence.
|
|
776
|
+
|
|
777
|
+
### Minimal example
|
|
691
778
|
|
|
692
779
|
```ts
|
|
693
780
|
async function signMultipleDocuments(documents: Document[]) {
|
|
@@ -711,36 +798,74 @@ async function signMultipleDocuments(documents: Document[]) {
|
|
|
711
798
|
}
|
|
712
799
|
```
|
|
713
800
|
|
|
801
|
+
### Production-grade example with `endSigningSession`
|
|
802
|
+
|
|
803
|
+
Between signing ceremonies on the same app session, call [`endSigningSession`](#endsigningsession-promisevoid) so the next `loginWithAccessToken` + `presentCaptiveSigning` pair starts from a clean SDK state. This avoids the iOS WebKit race that caused captive signing to hang on the second consecutive open in versions ≤ 1.0.1. Always run it in a `finally` block so it executes on cancel and error paths too.
|
|
804
|
+
|
|
805
|
+
```ts
|
|
806
|
+
async function signMultipleDocumentsSafe(documents: Document[]) {
|
|
807
|
+
const results: SigningResult[] = [];
|
|
808
|
+
|
|
809
|
+
for (const document of documents) {
|
|
810
|
+
const session = await fetchSigningSession(document.id);
|
|
811
|
+
|
|
812
|
+
try {
|
|
813
|
+
await DocuSign.loginWithAccessToken(session);
|
|
814
|
+
const result = await DocuSign.presentCaptiveSigning({
|
|
815
|
+
envelopeId: session.envelopeId,
|
|
816
|
+
recipientUserName: session.userName,
|
|
817
|
+
recipientEmail: session.email,
|
|
818
|
+
recipientClientUserId: session.recipientClientUserId,
|
|
819
|
+
});
|
|
820
|
+
results.push(result);
|
|
821
|
+
|
|
822
|
+
if (result.status !== 'completed') break;
|
|
823
|
+
} finally {
|
|
824
|
+
await DocuSign.endSigningSession();
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
return results;
|
|
829
|
+
}
|
|
830
|
+
```
|
|
831
|
+
|
|
714
832
|
Between signings, you can also show a confirmation prompt ("sign another document?") and only continue if the user agrees.
|
|
715
833
|
|
|
716
834
|
## Error handling
|
|
717
835
|
|
|
718
|
-
|
|
836
|
+
Every failure rejects with a `DocuSignError`, on both platforms, with the same fields:
|
|
719
837
|
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
| `not_initialized` | `initialize()` was not called first | Call `initialize()` before any other method |
|
|
726
|
-
| `not_logged_in` | `loginWithAccessToken()` was not called first | Call `loginWithAccessToken()` before `presentCaptiveSigning()` |
|
|
838
|
+
- `code` says what failed, such as `login_failed` or `signing_in_progress`. It is stable and safe to branch on.
|
|
839
|
+
- `reason` says why: `usage`, `network`, `auth`, `configuration`, `recipient` or `unknown`. The package sets it only from facts it can verify, so it never guesses.
|
|
840
|
+
- `message` is English text for developers. Never show it to users.
|
|
841
|
+
- `native` and `http` carry the raw SDK error and any DocuSign response behind the failure.
|
|
842
|
+
- `toAttributes()` flattens all of it into primitive values for Amplitude, New Relic, Sentry or any other tool.
|
|
727
843
|
|
|
728
|
-
|
|
844
|
+
The package shows no UI, ships no user-facing strings and logs nothing in production. Your app picks the copy from `reason` and decides where errors are recorded:
|
|
729
845
|
|
|
730
846
|
```ts
|
|
731
847
|
try {
|
|
732
848
|
await DocuSign.presentCaptiveSigning(params);
|
|
733
849
|
} catch (error) {
|
|
734
|
-
if (error
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
} else {
|
|
739
|
-
reportError(error);
|
|
850
|
+
if (!(error instanceof DocuSign.DocuSignError)) throw error;
|
|
851
|
+
showToast({ title: t(DOCUSIGN_ERROR_COPY_KEY[error.reason]) });
|
|
852
|
+
if (error.reason === 'auth') {
|
|
853
|
+
await startOverWithFreshSession();
|
|
740
854
|
}
|
|
741
855
|
}
|
|
742
856
|
```
|
|
743
857
|
|
|
858
|
+
| `reason` | Who fixes it | Suggested copy | Retry |
|
|
859
|
+
| --- | --- | --- | --- |
|
|
860
|
+
| `usage` | the app developer | generic | no, it is a bug |
|
|
861
|
+
| `network` | nobody, the connection was lost | "Check your connection and try again." | yes |
|
|
862
|
+
| `auth` | backend token minting | "Your signing session expired." | after a fresh session |
|
|
863
|
+
| `configuration` | DocuSign admin, or `AppIdentifierPrefix` on iOS | "Signing isn't available right now." | no |
|
|
864
|
+
| `recipient` | backend envelope creation | "Please contact the sender." | no |
|
|
865
|
+
| `unknown` | investigate with `native` | generic | yes |
|
|
866
|
+
|
|
867
|
+
The [error handling guide](docs/ERROR_HANDLING.md) covers the full error model, translated copy with i18next, a retry policy, sending errors to Amplitude, New Relic and Sentry, the dashboards and queries to read them in production, and worked examples for every reason. Its code samples are type-checked in CI.
|
|
868
|
+
|
|
744
869
|
## Security considerations
|
|
745
870
|
|
|
746
871
|
1. **Never log access tokens.** If you use LogRocket, Sentry, Datadog, or any other session recording tool, add the signing session endpoint and any DocuSign token fields to your network scrub list.
|
|
@@ -774,35 +899,37 @@ The config plugin writes these keys automatically, or you can configure them man
|
|
|
774
899
|
|
|
775
900
|
### iOS build fails with "No such module 'DocuSignSDK'"
|
|
776
901
|
|
|
777
|
-
Ensure `pod install` completed successfully inside `ios/`. The podspec declares a dependency on `DocuSign
|
|
902
|
+
Ensure `pod install` completed successfully inside `ios/`. The podspec declares a dependency on the `DocuSign` pod; if CocoaPods trunk is unreachable, the pod cannot be installed. Check your network, proxy, and CocoaPods version (`pod --version` should be 1.14+).
|
|
778
903
|
|
|
779
904
|
### iOS build fails with "Undefined symbols" for DSMManager
|
|
780
905
|
|
|
781
906
|
The DocuSign SDK must be set to `use_frameworks!` mode. Most Expo projects use frameworks by default. If you recently switched to static libraries, add `use_frameworks! :linkage => :static` to your Podfile and rebuild.
|
|
782
907
|
|
|
783
|
-
### Android build fails with "Could not find com.docusign:androidsdk:2.1.
|
|
908
|
+
### Android build fails with "Could not find com.docusign:androidsdk:2.1.7"
|
|
784
909
|
|
|
785
910
|
The DocuSign Android SDK is not on Maven Central; it is hosted on DocuSign's own Maven repository. Ensure the config plugin has added the repo to your project-level `build.gradle`. If running a bare project, manually add:
|
|
786
911
|
|
|
787
912
|
```groovy
|
|
788
913
|
allprojects {
|
|
789
914
|
repositories {
|
|
790
|
-
maven { url "https://
|
|
915
|
+
maven { url "https://docucdn-a.akamaihd.net/prod/docusignandroidsdk" }
|
|
791
916
|
}
|
|
792
917
|
}
|
|
793
918
|
```
|
|
794
919
|
|
|
920
|
+
This is the URL DocuSign's own [Android SDK install guide](https://github.com/docusign/mobile-android-sdk) uses. It is a static file host with no index page, so opening it in a browser returns 404 even though Gradle resolves artifacts under it, such as `com/docusign/androidsdk/2.1.7/androidsdk-2.1.7.pom`. It also serves no `maven-metadata.xml`, so declare exact versions: a dynamic version such as `2.+` does not resolve.
|
|
921
|
+
|
|
795
922
|
### "not_logged_in" error when calling `presentCaptiveSigning`
|
|
796
923
|
|
|
797
924
|
The SDK login state is in-memory and does not survive app restarts. Always call `loginWithAccessToken()` before `presentCaptiveSigning()` within the same app session.
|
|
798
925
|
|
|
799
926
|
### Access token expired mid-signing
|
|
800
927
|
|
|
801
|
-
DocuSign access tokens are valid for about 1 hour. If a token expires while the signing UI is open, the
|
|
928
|
+
DocuSign access tokens are valid for about 1 hour. If a token expires while the signing UI is open, the promise rejects with a `DocuSignError`. Catch it, fetch a fresh session from your backend, and start over rather than retrying the same session.
|
|
802
929
|
|
|
803
930
|
### `login_failed` on iOS even with a valid token
|
|
804
931
|
|
|
805
|
-
If `loginWithAccessToken` rejects with `login_failed`
|
|
932
|
+
If `loginWithAccessToken` rejects with `login_failed` and `reason: 'configuration'`, DocuSign accepted the token at `/oauth/userinfo` but the SDK still refused it. When the same token works on Android, the most likely cause is a missing `AppIdentifierPrefix` entry in your `Info.plist`.
|
|
806
933
|
|
|
807
934
|
The DocuSign iOS SDK uses the Apple Keychain to store auth state. Without `AppIdentifierPrefix`, it cannot access the Keychain group and rejects the login at the SDK level, regardless of token validity.
|
|
808
935
|
|
|
@@ -828,10 +955,10 @@ The module uses `appContext.activityProvider.currentActivity` to get the current
|
|
|
828
955
|
| This package version | Expo SDK | React Native | iOS SDK | Android SDK |
|
|
829
956
|
| -------------------- | -------- | ------------ | ------------------ | ---------------------- |
|
|
830
957
|
| 1.0.x | 55.x | 0.82.x | DocuSign iOS 4.1.1 | DocuSign Android 2.1.4 |
|
|
958
|
+
| 2.0.x | 55.x+ | 0.85.x+ | DocuSign iOS 4.3.0 | DocuSign Android 2.1.7 |
|
|
831
959
|
|
|
832
960
|
## Limitations
|
|
833
961
|
|
|
834
|
-
- **URL-based captive signing is iOS-only.** `presentCaptiveSigningWithUrl` is supported on iOS via DocuSign's iOS SDK 4.1.1. The DocuSign Android SDK 2.1.4 does not expose a public API that accepts a pre-minted recipient view URL, so the method throws `not_implemented` on Android. On Android, use `loginWithAccessToken` + `presentCaptiveSigning` (the session path). Your backend can branch response shape per platform.
|
|
835
962
|
- **Offline signing not exposed.** DocuSign's Android SDK supports offline signing via `com.docusign:sdk-offline-signing`. This package does not currently expose offline APIs. If you need offline signing, open an issue or send a pull request.
|
|
836
963
|
- **Template management not exposed.** The SDK's template caching and download APIs are not wrapped. Template creation should happen server-side via the DocuSign REST API.
|
|
837
964
|
- **Custom UI not supported.** The signing UI is provided by the DocuSign SDK and cannot be customized from this package. DocuSign owns the look and feel of the signing ceremony (this is intentional for legal compliance consistency).
|
|
@@ -864,9 +991,9 @@ Create a free DocuSign developer account at https://developers.docusign.com. It
|
|
|
864
991
|
|
|
865
992
|
Configure a DocuSign Connect webhook that points to your backend. DocuSign will push envelope status updates (sent, delivered, completed, declined, voided) as they happen. Use the webhook as your source of truth and treat the mobile-side `SigningResult` as a UX signal only.
|
|
866
993
|
|
|
867
|
-
###
|
|
994
|
+
### How much does the DocuSign SDK add to my app bundle?
|
|
868
995
|
|
|
869
|
-
The DocuSign native SDKs
|
|
996
|
+
This npm package itself is under 1 MB (TypeScript + native bridge sources only, see [SDK bundling policy](#sdk-bundling-policy)). The size impact comes from the upstream DocuSign native SDKs that consumers pull from CocoaPods (iOS) and DocuSign's Maven repo (Android) at consumer build time. They add tens of MB per platform: full PDF viewer, signature pad, form renderer, and offline sync engine. Measure your own delta by running `du -sh` on your release IPA / APK before and after adding the dependency.
|
|
870
997
|
|
|
871
998
|
### Can I ship this alongside `react-native-pdf` or another PDF viewer?
|
|
872
999
|
|
package/android/build.gradle
CHANGED
|
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
|
|
|
2
2
|
apply plugin: 'kotlin-android'
|
|
3
3
|
|
|
4
4
|
group = 'expo.modules.docusign'
|
|
5
|
-
version = '1.0.
|
|
5
|
+
version = '1.0.5'
|
|
6
6
|
|
|
7
7
|
buildscript {
|
|
8
8
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -41,7 +41,7 @@ android {
|
|
|
41
41
|
minSdkVersion safeExtGet("minSdkVersion", 24)
|
|
42
42
|
targetSdkVersion safeExtGet("targetSdkVersion", 35)
|
|
43
43
|
versionCode 1
|
|
44
|
-
versionName "1.0.
|
|
44
|
+
versionName "1.0.5"
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
buildFeatures {
|
|
@@ -70,14 +70,14 @@ dependencies {
|
|
|
70
70
|
// collides with expo-image (and any other Glide-based library) at dex time.
|
|
71
71
|
// We exclude the upstream sdk-pdf and link a locally-stripped copy from
|
|
72
72
|
// libs/ that has the generated Glide classes removed.
|
|
73
|
-
implementation('com.docusign:androidsdk:2.1.
|
|
73
|
+
implementation('com.docusign:androidsdk:2.1.7') {
|
|
74
74
|
exclude group: 'com.docusign', module: 'sdk-pdf'
|
|
75
75
|
}
|
|
76
|
-
implementation 'com.docusign:sdk-common:2.1.
|
|
76
|
+
implementation 'com.docusign:sdk-common:2.1.7'
|
|
77
77
|
// Direct file reference instead of flatDir (name:..., ext:...). Gradle 9.0 no
|
|
78
78
|
// longer honors subproject-scoped flatDir when resolving across project
|
|
79
|
-
// boundaries, so the stripped AAR (placed at libs/sdk-pdf-2.1.
|
|
79
|
+
// boundaries, so the stripped AAR (placed at libs/sdk-pdf-2.1.7-stripped.aar
|
|
80
80
|
// by the config plugin) wasn't found and the build failed with
|
|
81
|
-
// "Could not find :sdk-pdf-2.1.
|
|
82
|
-
implementation files("$projectDir/libs/sdk-pdf-2.1.
|
|
81
|
+
// "Could not find :sdk-pdf-2.1.7-stripped:".
|
|
82
|
+
implementation files("$projectDir/libs/sdk-pdf-2.1.7-stripped.aar")
|
|
83
83
|
}
|