@zkp2p/sdk 0.14.2 → 0.14.3

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 CHANGED
@@ -75,6 +75,45 @@ hosts and custom window handling with account-status polling at least ten second
75
75
  apart. Deploy the hosted page before using the SDK helper. See the
76
76
  [flow specification](https://github.com/zkp2p/zkp2p-clients/blob/main/docs/venmo-gmail-connect.md).
77
77
 
78
+ ### Native app return
79
+
80
+ SDK `0.14.3` adds optional `returnUrl` to the URL builder. Partners
81
+ supply their callback directly; no callback registration with Peer or deployment
82
+ setting is required. Deploy the hosted-page update before enabling this flow.
83
+
84
+ ```ts
85
+ import { getVenmoGmailConnectUrl } from '@zkp2p/sdk';
86
+ import * as WebBrowser from 'expo-web-browser';
87
+
88
+ // Use a callback scheme registered in your app binary.
89
+ const returnUrl = 'partner-app://venmo-linked';
90
+ const connectUrl = getVenmoGmailConnectUrl({ payeeDetails, returnUrl });
91
+ await WebBrowser.openAuthSessionAsync(connectUrl, returnUrl);
92
+ // Re-check your backend's seller-credential/status after return or dismissal.
93
+ ```
94
+
95
+ Use a scheme registered in your Expo app binary; Expo Go is not a substitute
96
+ for testing your app's callback. See Expo's
97
+ [`openAuthSessionAsync` documentation](https://docs.expo.dev/versions/latest/sdk/webbrowser/#webbrowseropenauthsessionasyncurl-redirecturl-options).
98
+ The browser popup helper remains browser-only; native hosts use the URL builder.
99
+
100
+ Peer keeps Google's OAuth callback on Peer and verifies the selected account
101
+ before navigating to `returnUrl` unchanged. No Google codes, tokens, email,
102
+ account hash, or success flag are appended. If automatic navigation is blocked,
103
+ select **Return to your app**. Consent or verification errors stay visible and
104
+ also offer a manual return. A return, dismissal, or cancellation is not proof of
105
+ linking: only an active `google_oauth` credential from the status API is linked.
106
+
107
+ Apps that need no SDK can build the same URL themselves:
108
+ `https://app.peer.xyz/connect/venmo?returnUrl=<URL-encoded-callback>#<payeeDetails>`.
109
+ The query parameter must precede the account hash fragment. Malformed URLs,
110
+ unsafe schemes, embedded credentials, and duplicate parameters are rejected
111
+ before consent or credential upload.
112
+
113
+ Omit `returnUrl` or leave it empty to keep the existing behavior: Peer attempts
114
+ `window.close()` after verification. Script-opened desktop popups can close;
115
+ mobile browser tabs that disallow closure keep the success message visible.
116
+
78
117
  ### Popup customization
79
118
 
80
119
  Pass `appearance` to either hosted-link helper and `popup` to the browser opener:
@@ -2,11 +2,11 @@
2
2
  "schemaVersion": 2,
3
3
  "source": {
4
4
  "repository": "zkp2p/zkp2p-clients",
5
- "commitSha": "a87f38c512f987fc3b9234b5aee31115bf840a18",
5
+ "commitSha": "e848bb1cab3615498514e767e43ea50ec464a633",
6
6
  "kind": "github",
7
7
  "distributable": true
8
8
  },
9
- "sdkPackageVersion": "0.14.2",
9
+ "sdkPackageVersion": "0.14.3",
10
10
  "contractsPackageVersion": "0.4.2-rc.2",
11
11
  "indexerSchemaPackageVersion": "0.22.0",
12
12
  "activeDisputeStack": {
@@ -1,5 +1,5 @@
1
1
  import { currencyKeccak256, getCurrencyInfoFromHash } from './chunk-ZB22BZLZ.mjs';
2
- import { __export } from './chunk-BVBHBKX7.mjs';
2
+ import { __export } from './chunk-BY77PPIP.mjs';
3
3
  import { hexToBytes, keccak256, toBytes, bytesToHex } from 'viem';
4
4
 
5
5
  // src/utils/bigint.ts
@@ -97848,5 +97848,5 @@ function enrichPvIntentView(view, chainId, env = "production") {
97848
97848
  }
97849
97849
 
97850
97850
  export { DISPUTE_PROTECTION_POLICY_ABI, DISPUTE_PROTECTION_POLICY_ABI2, DisputeNullifierRegistry_default3 as DisputeNullifierRegistry_default, DisputeProtectionPolicy_default3 as DisputeProtectionPolicy_default, DisputeVerifier_default3 as DisputeVerifier_default, IntentLifecycleHookV1_default3 as IntentLifecycleHookV1_default, METHOD_NAME_TO_HASH, MultiAttestationVerifier_default3 as MultiAttestationVerifier_default, ORCHESTRATOR_V3_ABI2 as ORCHESTRATOR_V3_ABI, OrchestratorRegistry_default3 as OrchestratorRegistry_default, OrchestratorV3_default3 as OrchestratorV3_default, PAYMENT_PLATFORMS, STAKE_VAULT_ABI2 as STAKE_VAULT_ABI, SUPPORTED_PAYMENT_METHOD_HASHES, StakeVault_default3 as StakeVault_default, WhitelistPolicy_default3 as WhitelistPolicy_default, asciiToBytes32, enrichPvDepositView, enrichPvIntentView, ensureBytes32, getContracts, getDisputeProtectionPolicyContract, getGatingServiceAddress, getIntentGuardianContract, getOrchestratorV3Contract, getPaymentMethodsCatalog, getRateManagerContracts, getStakeVaultContract, hasIntentGuardian, matchesPaymentMethodNameAndHash, matchesQuotePaymentMethod, parseBigIntLike, parseDepositView, parseIntentView, resolveFiatCurrencyBytes32, resolvePaymentMethodHash, resolvePaymentMethodHashFromCatalog, resolvePaymentMethodNameFromHash };
97851
- //# sourceMappingURL=chunk-OP2REHNS.mjs.map
97852
- //# sourceMappingURL=chunk-OP2REHNS.mjs.map
97851
+ //# sourceMappingURL=chunk-2NJU3MGV.mjs.map
97852
+ //# sourceMappingURL=chunk-2NJU3MGV.mjs.map