@unifold/connect-react-native 0.1.51 → 0.1.52
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/README.md +6 -7
- package/dist/index.d.mts +34 -28
- package/dist/index.d.ts +34 -28
- package/dist/index.js +5 -5
- package/dist/index.mjs +5 -5
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ Link Pay uses `@stripe/stripe-react-native`, which includes **native** code (App
|
|
|
36
36
|
|
|
37
37
|
Importing `@unifold/connect-react-native` loads the Stripe UI registration in the same JS bundle as the provider. Ensure the peer dependencies in **Installation** above are installed so Metro does not duplicate native modules.
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
The Apple Pay **`merchantIdentifier`** in `app.json` is still required for the **native entitlement** at build time. The value used at runtime for `initStripe`, however, comes **only** from the Unifold dashboard (via the Stripe config endpoint) — the SDK no longer reads it from a prop or `app.json`, so make sure the dashboard value matches the id compiled into your build.
|
|
40
40
|
|
|
41
41
|
#### Expo Go vs development build vs prebuild
|
|
42
42
|
|
|
@@ -50,7 +50,7 @@ Importing `@unifold/connect-react-native` loads the Stripe UI registration in th
|
|
|
50
50
|
1. **Peer dependencies** — Install everything in **Installation** (or `expo install …`). Missing peers often show up as duplicate native modules or Metro resolution errors.
|
|
51
51
|
2. **`react-native-gesture-handler`** — In bare React Native, import it at the **entry file** first (see [React Navigation](https://reactnavigation.org/docs/getting-started/#installing-dependencies-into-a-bare-react-native-project)); Expo Router projects usually already satisfy this.
|
|
52
52
|
3. **`UnifoldProvider` placement** — Wrap near the root so `beginDeposit` and theme context are available app-wide. Call `setDevApiUrl` **before** the provider if you use staging in development (see example app).
|
|
53
|
-
4. **Stripe Link Pay** — Requires a **development / EAS build** on Expo (not Expo Go), the Stripe **config plugin** in `app.json`, and `config.
|
|
53
|
+
4. **Stripe Link Pay** — Requires a **development / EAS build** on Expo (not Expo Go), the Stripe **config plugin** in `app.json`, and `config.enableStripeLink: true`. Apple Pay's `merchantIdentifier` must be set in the `app.json` plugin (native entitlement); the runtime value is sourced from the Unifold dashboard (Stripe config endpoint), so keep the two in sync.
|
|
54
54
|
5. **Theme** — `UnifoldProvider` applies `ThemeProvider` to **all** children. If you use another theme system, nest it inside or outside deliberately so `useTheme` resolves as you expect.
|
|
55
55
|
|
|
56
56
|
## Quick Start
|
|
@@ -192,8 +192,9 @@ await beginDeposit({
|
|
|
192
192
|
| `config.fonts` | `FontConfig` | No | Granular font weight configuration |
|
|
193
193
|
| `config.components` | `ComponentConfig` | No | Component-specific token overrides |
|
|
194
194
|
| `config.sheetBorderRadius` | `SheetBorderRadius` | No | Border radius configuration for all bottom sheets (see below) |
|
|
195
|
-
| `config.
|
|
196
|
-
|
|
195
|
+
| `config.enableStripeLink` | `boolean` | No | Show Pay with Link (Stripe) in the deposit menu (default: omit / falsy hides it). Stripe is bundled with Connect. |
|
|
196
|
+
|
|
197
|
+
> **Apple Pay merchant id:** there is no longer an SDK config for this. The runtime value comes solely from the Unifold dashboard (Stripe config endpoint). Keep it in sync with the `merchantIdentifier` in your `app.json` Stripe plugin, which is still required for the native entitlement.
|
|
197
198
|
|
|
198
199
|
### SheetBorderRadius
|
|
199
200
|
|
|
@@ -251,8 +252,7 @@ const { beginDeposit, closeDeposit, publishableKey } = useUnifold();
|
|
|
251
252
|
| `destinationTokenAddress` | `string` | No | Target token contract address |
|
|
252
253
|
| `destinationTokenSymbol` | `string` | No | Target token symbol (e.g., `'USDC'`) |
|
|
253
254
|
| `recipientAddress` | `string` | No | Wallet address to receive funds |
|
|
254
|
-
| `
|
|
255
|
-
| `stripeOnrampPhone` | `string` | No | Pre-fills Stripe Link Pay phone (use with `stripeOnrampEmail` per Stripe’s flow) |
|
|
255
|
+
| `user` | `{ email?: string; phone?: string }` | No | Host-app-supplied user identity. Pre-fills supported flows — currently Stripe Link Pay uses `user.email` / `user.phone` (with both set, Stripe may skip verify steps). |
|
|
256
256
|
| `defaultChainType` | `'ethereum' \| 'solana' \| 'bitcoin'` | No | Pre-select source network type |
|
|
257
257
|
| `defaultChainId` | `string` | No | Pre-select source chain ID |
|
|
258
258
|
| `defaultTokenAddress` | `string` | No | Pre-select source token address |
|
|
@@ -308,7 +308,6 @@ import type {
|
|
|
308
308
|
| react-native-gesture-handler | >= 2.14.0 |
|
|
309
309
|
| react-native-svg | >= 13.0.0 |
|
|
310
310
|
| react-native-webview | >= 13.0.0 |
|
|
311
|
-
| expo-constants | Installed with Connect (>= 14) — mirrors `merchantIdentifier` from the Stripe Expo plugin into JS; optional override via `config.stripeMerchantIdentifier` |
|
|
312
311
|
|
|
313
312
|
## Support
|
|
314
313
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React$1, { ReactNode } from 'react';
|
|
2
|
-
export { AmountScreen, CreateSessionParams, CustomerVerification, KYCData, KYCWizardScreen, OnrampConfig, OnrampCustomer, OnrampError, OnrampErrorCode, OnrampScreen, OnrampSession, OnrampSessionTransactionDetails, OnrampStep, OnrampTransaction, StripeOnramp, StripeOnrampHook, StripeOnrampPreconfigure, StripeOnrampProps, getStripePublishableKey, setStripeOnrampApiUrl, setStripeOnrampPublishableKey, useStripeOnramp } from '@unifold/ui-react-native/stripe';
|
|
2
|
+
export { AmountScreen, CreateSessionParams, CustomerVerification, KYCData, KYCWizardScreen, OnrampConfig, OnrampCustomer, OnrampError, OnrampErrorCode, OnrampScreen, OnrampSession, OnrampSessionTransactionDetails, OnrampStep, OnrampTransaction, StripeOnramp, StripeOnrampConfig, StripeOnrampHook, StripeOnrampPreconfigure, StripeOnrampProps, getStripeConfig, getStripePublishableKey, setStripeOnrampApiUrl, setStripeOnrampPublishableKey, useStripeOnramp } from '@unifold/ui-react-native/stripe';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Unifold color palette for React Native
|
|
@@ -406,6 +406,18 @@ type TransferInputVariant = "single_input" | "double_input" | "compact";
|
|
|
406
406
|
type DepositMenuDisplay = "stacked" | "tabs";
|
|
407
407
|
/** Controls which screen opens first when the deposit modal is shown */
|
|
408
408
|
type DepositInitialScreen = "main" | "transfer" | "card" | "tracker" | "cashapp" | "wallet";
|
|
409
|
+
/**
|
|
410
|
+
* Host-app-supplied user identity used to pre-fill supported flows.
|
|
411
|
+
* Currently consumed by Stripe Link Pay (email/phone pre-fill). Kept as an
|
|
412
|
+
* extensible object so more fields can be added later without new top-level
|
|
413
|
+
* props.
|
|
414
|
+
*/
|
|
415
|
+
interface UnifoldUser {
|
|
416
|
+
/** Pre-fills the user's email (e.g. Stripe Link Pay). */
|
|
417
|
+
email?: string;
|
|
418
|
+
/** Pre-fills the user's phone; with `email`, Stripe may skip verify steps. */
|
|
419
|
+
phone?: string;
|
|
420
|
+
}
|
|
409
421
|
interface DepositModalProps {
|
|
410
422
|
/** Whether the modal is visible */
|
|
411
423
|
visible: boolean;
|
|
@@ -449,19 +461,14 @@ interface DepositModalProps {
|
|
|
449
461
|
/** Enable "Deposit with Card" (fiat on-ramp) option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
450
462
|
enableFiatOnramp?: boolean;
|
|
451
463
|
/** Show "Pay with Link" (Stripe) option in the deposit menu */
|
|
452
|
-
|
|
453
|
-
/** Registered Stripe onramp component (Connect sets this from `
|
|
464
|
+
enableStripeLink?: boolean;
|
|
465
|
+
/** Registered Stripe onramp component (Connect sets this from `enableStripeLink`) */
|
|
454
466
|
StripeOnrampComponent?: React$1.ComponentType<any>;
|
|
455
|
-
/** Pre-fills Stripe Link Pay email — set via `beginDeposit({ stripeOnrampEmail })` (forwarded as `email` on `StripeOnramp`) */
|
|
456
|
-
stripeOnrampEmail?: string;
|
|
457
|
-
/** Pre-fills Stripe Link Pay phone — set via `beginDeposit({ stripeOnrampPhone })` (forwarded as `phone` on `StripeOnramp`) */
|
|
458
|
-
stripeOnrampPhone?: string;
|
|
459
467
|
/**
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
* in app.json (the UI reads it via `expo-constants`).
|
|
468
|
+
* Host-app-supplied user identity. Pre-fills supported flows (currently Stripe
|
|
469
|
+
* Link Pay email/phone). Set via `beginDeposit({ user })`.
|
|
463
470
|
*/
|
|
464
|
-
|
|
471
|
+
user?: UnifoldUser;
|
|
465
472
|
/** Where to render the Stripe payment method selector: "header" or "inline". Default: "header" */
|
|
466
473
|
stripePaymentSelectorPosition?: "header" | "inline";
|
|
467
474
|
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
@@ -529,7 +536,7 @@ interface DepositModalProps {
|
|
|
529
536
|
/** Price impact & slippage info sheet */
|
|
530
537
|
infoSheet?: BorderRadiusConfig;
|
|
531
538
|
/** Stripe Link Pay sheet */
|
|
532
|
-
|
|
539
|
+
stripeLink?: BorderRadiusConfig;
|
|
533
540
|
/** Cash App sheet */
|
|
534
541
|
cashApp?: BorderRadiusConfig;
|
|
535
542
|
/** Connect Wallet sheet */
|
|
@@ -636,7 +643,7 @@ interface UnifoldConnectProviderConfig {
|
|
|
636
643
|
* Show "Pay with Link" (Stripe) option in the deposit menu.
|
|
637
644
|
* Stripe onramp is bundled with Connect; set to false to hide the option.
|
|
638
645
|
*/
|
|
639
|
-
|
|
646
|
+
enableStripeLink?: boolean;
|
|
640
647
|
/** Enable "Transfer Crypto" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
641
648
|
enableTransferCrypto?: boolean;
|
|
642
649
|
/** Enable "Pay with Cash App" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? false. */
|
|
@@ -645,17 +652,13 @@ interface UnifoldConnectProviderConfig {
|
|
|
645
652
|
enableConnectWallet?: boolean;
|
|
646
653
|
/** Enable "Deposit with Card" (fiat on-ramp) option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
647
654
|
enableFiatOnramp?: boolean;
|
|
648
|
-
/**
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
/** Where to render the Stripe payment method selector: "header" (above amount) or "inline" (below). Default: "header" */
|
|
656
|
-
stripePaymentSelectorPosition?: "header" | "inline";
|
|
657
|
-
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
658
|
-
stripeSkipSuccessConfirmation?: boolean;
|
|
655
|
+
/** Stripe Link Pay tuning options (only applies when `enableStripeLink` is true). */
|
|
656
|
+
stripeLink?: {
|
|
657
|
+
/** Where to render the Stripe payment method selector: "header" (above amount) or "inline" (below). Default: "header" */
|
|
658
|
+
paymentSelectorPosition?: "header" | "inline";
|
|
659
|
+
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
660
|
+
skipSuccessConfirmation?: boolean;
|
|
661
|
+
};
|
|
659
662
|
};
|
|
660
663
|
}
|
|
661
664
|
interface DepositResult {
|
|
@@ -679,10 +682,13 @@ interface DepositConfig {
|
|
|
679
682
|
defaultChainId?: string;
|
|
680
683
|
defaultTokenAddress?: string;
|
|
681
684
|
showBalance?: boolean;
|
|
682
|
-
/**
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
685
|
+
/**
|
|
686
|
+
* Host-app-supplied user identity (`beginDeposit` only — not provider config).
|
|
687
|
+
* Pre-fills supported flows; currently Stripe Link Pay uses `user.email` /
|
|
688
|
+
* `user.phone` (with both set, Stripe may skip verify steps). Kept as an
|
|
689
|
+
* object so more fields can be added later without new `stripeXxx` params.
|
|
690
|
+
*/
|
|
691
|
+
user?: UnifoldUser;
|
|
686
692
|
/**
|
|
687
693
|
* How deposit confirmation and waiting behavior is handled.
|
|
688
694
|
* - auto_ui (default): Automatically show "Processing deposit" UI and start polling after 10s. No "I've deposited" button.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React$1, { ReactNode } from 'react';
|
|
2
|
-
export { AmountScreen, CreateSessionParams, CustomerVerification, KYCData, KYCWizardScreen, OnrampConfig, OnrampCustomer, OnrampError, OnrampErrorCode, OnrampScreen, OnrampSession, OnrampSessionTransactionDetails, OnrampStep, OnrampTransaction, StripeOnramp, StripeOnrampHook, StripeOnrampPreconfigure, StripeOnrampProps, getStripePublishableKey, setStripeOnrampApiUrl, setStripeOnrampPublishableKey, useStripeOnramp } from '@unifold/ui-react-native/stripe';
|
|
2
|
+
export { AmountScreen, CreateSessionParams, CustomerVerification, KYCData, KYCWizardScreen, OnrampConfig, OnrampCustomer, OnrampError, OnrampErrorCode, OnrampScreen, OnrampSession, OnrampSessionTransactionDetails, OnrampStep, OnrampTransaction, StripeOnramp, StripeOnrampConfig, StripeOnrampHook, StripeOnrampPreconfigure, StripeOnrampProps, getStripeConfig, getStripePublishableKey, setStripeOnrampApiUrl, setStripeOnrampPublishableKey, useStripeOnramp } from '@unifold/ui-react-native/stripe';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Unifold color palette for React Native
|
|
@@ -406,6 +406,18 @@ type TransferInputVariant = "single_input" | "double_input" | "compact";
|
|
|
406
406
|
type DepositMenuDisplay = "stacked" | "tabs";
|
|
407
407
|
/** Controls which screen opens first when the deposit modal is shown */
|
|
408
408
|
type DepositInitialScreen = "main" | "transfer" | "card" | "tracker" | "cashapp" | "wallet";
|
|
409
|
+
/**
|
|
410
|
+
* Host-app-supplied user identity used to pre-fill supported flows.
|
|
411
|
+
* Currently consumed by Stripe Link Pay (email/phone pre-fill). Kept as an
|
|
412
|
+
* extensible object so more fields can be added later without new top-level
|
|
413
|
+
* props.
|
|
414
|
+
*/
|
|
415
|
+
interface UnifoldUser {
|
|
416
|
+
/** Pre-fills the user's email (e.g. Stripe Link Pay). */
|
|
417
|
+
email?: string;
|
|
418
|
+
/** Pre-fills the user's phone; with `email`, Stripe may skip verify steps. */
|
|
419
|
+
phone?: string;
|
|
420
|
+
}
|
|
409
421
|
interface DepositModalProps {
|
|
410
422
|
/** Whether the modal is visible */
|
|
411
423
|
visible: boolean;
|
|
@@ -449,19 +461,14 @@ interface DepositModalProps {
|
|
|
449
461
|
/** Enable "Deposit with Card" (fiat on-ramp) option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
450
462
|
enableFiatOnramp?: boolean;
|
|
451
463
|
/** Show "Pay with Link" (Stripe) option in the deposit menu */
|
|
452
|
-
|
|
453
|
-
/** Registered Stripe onramp component (Connect sets this from `
|
|
464
|
+
enableStripeLink?: boolean;
|
|
465
|
+
/** Registered Stripe onramp component (Connect sets this from `enableStripeLink`) */
|
|
454
466
|
StripeOnrampComponent?: React$1.ComponentType<any>;
|
|
455
|
-
/** Pre-fills Stripe Link Pay email — set via `beginDeposit({ stripeOnrampEmail })` (forwarded as `email` on `StripeOnramp`) */
|
|
456
|
-
stripeOnrampEmail?: string;
|
|
457
|
-
/** Pre-fills Stripe Link Pay phone — set via `beginDeposit({ stripeOnrampPhone })` (forwarded as `phone` on `StripeOnramp`) */
|
|
458
|
-
stripeOnrampPhone?: string;
|
|
459
467
|
/**
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
* in app.json (the UI reads it via `expo-constants`).
|
|
468
|
+
* Host-app-supplied user identity. Pre-fills supported flows (currently Stripe
|
|
469
|
+
* Link Pay email/phone). Set via `beginDeposit({ user })`.
|
|
463
470
|
*/
|
|
464
|
-
|
|
471
|
+
user?: UnifoldUser;
|
|
465
472
|
/** Where to render the Stripe payment method selector: "header" or "inline". Default: "header" */
|
|
466
473
|
stripePaymentSelectorPosition?: "header" | "inline";
|
|
467
474
|
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
@@ -529,7 +536,7 @@ interface DepositModalProps {
|
|
|
529
536
|
/** Price impact & slippage info sheet */
|
|
530
537
|
infoSheet?: BorderRadiusConfig;
|
|
531
538
|
/** Stripe Link Pay sheet */
|
|
532
|
-
|
|
539
|
+
stripeLink?: BorderRadiusConfig;
|
|
533
540
|
/** Cash App sheet */
|
|
534
541
|
cashApp?: BorderRadiusConfig;
|
|
535
542
|
/** Connect Wallet sheet */
|
|
@@ -636,7 +643,7 @@ interface UnifoldConnectProviderConfig {
|
|
|
636
643
|
* Show "Pay with Link" (Stripe) option in the deposit menu.
|
|
637
644
|
* Stripe onramp is bundled with Connect; set to false to hide the option.
|
|
638
645
|
*/
|
|
639
|
-
|
|
646
|
+
enableStripeLink?: boolean;
|
|
640
647
|
/** Enable "Transfer Crypto" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
641
648
|
enableTransferCrypto?: boolean;
|
|
642
649
|
/** Enable "Pay with Cash App" option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? false. */
|
|
@@ -645,17 +652,13 @@ interface UnifoldConnectProviderConfig {
|
|
|
645
652
|
enableConnectWallet?: boolean;
|
|
646
653
|
/** Enable "Deposit with Card" (fiat on-ramp) option. Overrides dashboard default. Resolves as flag ?? dashboard value ?? true. */
|
|
647
654
|
enableFiatOnramp?: boolean;
|
|
648
|
-
/**
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
/** Where to render the Stripe payment method selector: "header" (above amount) or "inline" (below). Default: "header" */
|
|
656
|
-
stripePaymentSelectorPosition?: "header" | "inline";
|
|
657
|
-
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
658
|
-
stripeSkipSuccessConfirmation?: boolean;
|
|
655
|
+
/** Stripe Link Pay tuning options (only applies when `enableStripeLink` is true). */
|
|
656
|
+
stripeLink?: {
|
|
657
|
+
/** Where to render the Stripe payment method selector: "header" (above amount) or "inline" (below). Default: "header" */
|
|
658
|
+
paymentSelectorPosition?: "header" | "inline";
|
|
659
|
+
/** Skip the success confirmation screen and fire onComplete immediately. Default: false */
|
|
660
|
+
skipSuccessConfirmation?: boolean;
|
|
661
|
+
};
|
|
659
662
|
};
|
|
660
663
|
}
|
|
661
664
|
interface DepositResult {
|
|
@@ -679,10 +682,13 @@ interface DepositConfig {
|
|
|
679
682
|
defaultChainId?: string;
|
|
680
683
|
defaultTokenAddress?: string;
|
|
681
684
|
showBalance?: boolean;
|
|
682
|
-
/**
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
685
|
+
/**
|
|
686
|
+
* Host-app-supplied user identity (`beginDeposit` only — not provider config).
|
|
687
|
+
* Pre-fills supported flows; currently Stripe Link Pay uses `user.email` /
|
|
688
|
+
* `user.phone` (with both set, Stripe may skip verify steps). Kept as an
|
|
689
|
+
* object so more fields can be added later without new `stripeXxx` params.
|
|
690
|
+
*/
|
|
691
|
+
user?: UnifoldUser;
|
|
686
692
|
/**
|
|
687
693
|
* How deposit confirmation and waiting behavior is handled.
|
|
688
694
|
* - auto_ui (default): Automatically show "Processing deposit" UI and start polling after 10s. No "I've deposited" button.
|