@turnkey/sdk-react 5.5.8 → 6.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 CHANGED
@@ -1,15 +1,64 @@
1
1
  # @turnkey/sdk-react
2
2
 
3
+ ## 6.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#1250](https://github.com/tkhq/sdk/pull/1250) [`654fadc`](https://github.com/tkhq/sdk/commit/654fadc7b8296b7af7e5a68dee9ee6de20eef4c1) Author [@moeodeh3](https://github.com/moeodeh3) - ### `OtpVerification`
8
+
9
+ **What changed:** New required prop `otpEncryptionTargetBundle`
10
+
11
+ `otpEncryptionTargetBundle` comes from the `sendOtp` response:
12
+
13
+ ```ts
14
+ const { otpId, otpEncryptionTargetBundle } = await server.sendOtp({
15
+ appName: "Example App",
16
+ otpType: OtpType.Sms,
17
+ contact: phoneInput,
18
+ customSmsMessage: "Your OTP is {{.OtpCode}}",
19
+ userIdentifier: publicKey,
20
+ });
21
+ ```
22
+
23
+ ```tsx
24
+ // before
25
+ <OtpVerification
26
+ type={type}
27
+ contact={contact}
28
+ otpId={otpId}
29
+ // ...
30
+ />
31
+
32
+ // after
33
+ <OtpVerification
34
+ type={type}
35
+ contact={contact}
36
+ otpId={otpId}
37
+ otpEncryptionTargetBundle={otpEncryptionTargetBundle} // new
38
+ // ...
39
+ />
40
+ ```
41
+
42
+ ### Patch Changes
43
+
44
+ - Updated dependencies [[`d677115`](https://github.com/tkhq/sdk/commit/d677115e60aaee53319131723541211457803317), [`34522d4`](https://github.com/tkhq/sdk/commit/34522d447592138a82d34cd690091315f9748edb), [`f39e11e`](https://github.com/tkhq/sdk/commit/f39e11eb4dc6dde19516c3f28263528e424672f1), [`654fadc`](https://github.com/tkhq/sdk/commit/654fadc7b8296b7af7e5a68dee9ee6de20eef4c1), [`7a36539`](https://github.com/tkhq/sdk/commit/7a36539196856a8bd4ca4c54115fa9874ccc83fa), [`f39e11e`](https://github.com/tkhq/sdk/commit/f39e11eb4dc6dde19516c3f28263528e424672f1), [`34522d4`](https://github.com/tkhq/sdk/commit/34522d447592138a82d34cd690091315f9748edb), [`47c0ca4`](https://github.com/tkhq/sdk/commit/47c0ca4696c8a518f95550c35cfe4cb4985a2633), [`5624d54`](https://github.com/tkhq/sdk/commit/5624d5417d2cc30032ca4ce71da0a5c7ab9a462d), [`6128132`](https://github.com/tkhq/sdk/commit/6128132d910f658cdf83ecc1dec6598eb20c008a), [`7b80b1e`](https://github.com/tkhq/sdk/commit/7b80b1e9755b83988b5e49c34dff13dd92d9932f)]:
45
+ - @turnkey/crypto@2.9.0
46
+ - @turnkey/sdk-types@1.0.0
47
+ - @turnkey/sdk-server@6.0.0
48
+ - @turnkey/sdk-browser@6.0.0
49
+ - @turnkey/wallet-stamper@1.1.17
50
+
3
51
  ## 5.5.8
4
52
 
5
53
  ### Patch Changes
6
54
 
7
- - Updated dependencies [[`d05bd86`](https://github.com/tkhq/sdk/commit/d05bd86400d463c8f8c9788e69f0918db45662b5), [`8209887`](https://github.com/tkhq/sdk/commit/8209887d48bae7ea617645603a156aeb1cfbd2e7)]:
55
+ - Updated dependencies [[`d05bd86`](https://github.com/tkhq/sdk/commit/d05bd86400d463c8f8c9788e69f0918db45662b5), [`ef66673`](https://github.com/tkhq/sdk/commit/ef6667325d210c8aa0ea4c1d11d834ff28ddb66c), [`8209887`](https://github.com/tkhq/sdk/commit/8209887d48bae7ea617645603a156aeb1cfbd2e7), [`547566b`](https://github.com/tkhq/sdk/commit/547566be393b6c29ca8065664a1890389f1c9580)]:
8
56
  - @turnkey/sdk-server@5.3.0
57
+ - @turnkey/sdk-browser@5.16.1
9
58
  - @turnkey/sdk-types@0.14.0
10
59
  - @turnkey/crypto@2.8.14
11
- - @turnkey/sdk-browser@5.16.1
12
60
  - @turnkey/wallet-stamper@1.1.16
61
+ - next@15.5.15
13
62
 
14
63
  ## 5.5.7
15
64
 
@@ -1 +1 @@
1
- {"version":3,"file":"Au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ACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,kBAAkB,CAAC,EAAE,eAAe,CAAC,4BAA4B,CAAC,CAAC;IACnE,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;IACjC,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;;GAGG;AACH,QAAA,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,SAAS,CAsuB7B,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -83,6 +83,7 @@ const Auth = ({
83
83
  const [email, setEmail] = React.useState("");
84
84
  const [phone, setPhone] = React.useState("");
85
85
  const [otpId, setOtpId] = React.useState(null);
86
+ const [otpEncryptionTargetBundle, setOtpEncryptionTargetBundle] = React.useState(null);
86
87
  const [step, setStep] = React.useState("auth");
87
88
  const [loading, setLoading] = React.useState();
88
89
  const [oauthLoading, setOauthLoading] = React.useState("");
@@ -160,7 +161,7 @@ const Auth = ({
160
161
  attestation
161
162
  },
162
163
  ...(customAccounts && {
163
- customAccounts
164
+ customAccounts: customAccounts
164
165
  })
165
166
  });
166
167
  if (response?.subOrganizationId) {
@@ -224,7 +225,8 @@ const Auth = ({
224
225
  userIdentifier: publicKey
225
226
  });
226
227
  if (initAuthResponse && initAuthResponse.otpId) {
227
- setOtpId(initAuthResponse?.otpId);
228
+ setOtpId(initAuthResponse.otpId);
229
+ setOtpEncryptionTargetBundle(initAuthResponse.otpEncryptionTargetBundle);
228
230
  setStep(otpType);
229
231
  } else {
230
232
  onError(constants.authErrors.otp.sendFailed);
@@ -634,6 +636,7 @@ const Auth = ({
634
636
  type: step,
635
637
  contact: step === constants.OtpType.Email ? email : phone,
636
638
  otpId: otpId,
639
+ otpEncryptionTargetBundle: otpEncryptionTargetBundle,
637
640
  alphanumeric: otpConfig?.alphanumeric,
638
641
  includeUnverifiedSubOrgs: otpConfig?.includeUnverifiedSubOrgs,
639
642
  sessionLengthSeconds: authConfig.sessionLengthSeconds,