Skip to content

Commit 84bdde8

Browse files
authored
Merge pull request #1030 from Web3Auth/mpc-core-kit-3.4.0
Update MPC CoreKit docs
2 parents 3c8dcac + 53986a1 commit 84bdde8

File tree

2 files changed

+80
-2
lines changed

2 files changed

+80
-2
lines changed

docs/sdk/mpc-core-kit/mpc-core-kit-js/authentication/login-jwt.mdx

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,52 @@ that the first 32 bytes are provided in hexadecimal format when using the ed2551
154154
```tsx
155155
import { JWTLoginParams } from "@web3auth/mpc-core-kit";
156156

157-
const jwtLoginParams = {
157+
const jwtLoginParams: JWTLoginParams = {
158158
verifier: "YOUR_VERIFIER_NAME",
159159
verifierId: "USER'S_VERIFIER_ID",
160160
idToken: "USER'S_ID_TOKEN",
161161
// focus-next-line
162162
importTssKey: "SECP256K1_PRIVATE_KEY_OR_ED25519_SEED",
163-
} as JWTLoginParams;
163+
};
164+
165+
await coreKitInstance.loginWithJWT(jwtLoginParams);
166+
```
167+
168+
## Importing an existing Single Factor Auth(SFA) Key.
169+
170+
When logging in for the first time, you can import an existing SFA key using the
171+
`registerExistingSFAKey` parameter. By default, the value of this parameter is `false`.
172+
173+
Additionally, this parameter allows you to leverage the
174+
[wallet pregeneration API](/docs/features/wallet-pregeneration) to pre-generate a wallet address.
175+
This approach enhances the user experience by enabling the creation of a wallet without requiring
176+
end users to initiate or complete an authentication flow.
177+
178+
To use this feature, you need to make sure that you are using the same `verifier` for both the SFA
179+
SDK/ Wallet Pregeneration API and MPC Core Kit SDK.
180+
181+
:::info
182+
183+
Please keep the following points in mind when using this feature:
184+
185+
1. Once the SFA Key is imported, users will no longer be able to access their account through the
186+
SFA SDK.
187+
2. SFA import is available exclusively for Web3Auth SFA v2 users and is not compatible with older
188+
users (v1) of SFA.
189+
190+
:::
191+
192+
```tsx
193+
import { JWTLoginParams } from "@web3auth/mpc-core-kit";
194+
195+
const jwtLoginParams: JWTLoginParams = {
196+
// Please make sure to use the same verifier of the SFA/ Wallet Pregeneration API
197+
verifier: "YOUR_VERIFIER_NAME",
198+
verifierId: "USER'S_VERIFIER_ID",
199+
idToken: "USER'S_ID_TOKEN",
200+
// focus-next-line
201+
registerExistingSFAKey: true,
202+
};
164203

165204
await coreKitInstance.loginWithJWT(jwtLoginParams);
166205
```

docs/sdk/mpc-core-kit/mpc-core-kit-js/authentication/login-oauth.mdx

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,45 @@ const verifierConfig: SubVerifierDetailsParams = {
218218
await coreKitInstance.loginWithOAuth(verifierConfig);
219219
```
220220

221+
## Importing an existing Single Factor Auth(SFA) Key.
222+
223+
When logging in for the first time, you can import an existing SFA key using the
224+
`registerExistingSFAKey` parameter. By default, the value of this parameter is `false`.
225+
226+
Additionally, this parameter allows you to leverage the
227+
[wallet pregeneration API](/docs/features/wallet-pregeneration) to pre-generate a wallet address.
228+
This approach enhances the user experience by enabling the creation of a wallet without requiring
229+
end users to initiate or complete an authentication flow.
230+
231+
To use this feature, you need to make sure that you are using the same `verifier` for both the SFA
232+
SDK/ Wallet Pregeneration API and MPC Core Kit SDK.
233+
234+
:::info
235+
236+
Please keep the following points in mind when using this feature:
237+
238+
1. Once the SFA Key is imported, users will no longer be able to access their account through the
239+
SFA SDK.
240+
2. SFA import is available exclusively for Web3Auth SFA v2 users and is not compatible with older
241+
users (v1) of SFA.
242+
243+
:::
244+
245+
```tsx
246+
const verifierConfig: SubVerifierDetailsParams = {
247+
subVerifierDetails: {
248+
typeOfLogin: "google",
249+
// Please make sure to use the same verifier of the SFA/ Wallet Pregeneration API
250+
verifier: "w3a-google-demo",
251+
clientId: "519228911939-cri01h55lsjbsia1k7ll6qpalrus75ps.apps.googleusercontent.com",
252+
},
253+
// focus-next-line
254+
registerExistingSFAKey: true,
255+
};
256+
257+
await coreKitInstance.loginWithOAuth(verifierConfig);
258+
```
259+
221260
## Popup Mode
222261

223262
If you're using the popup mode (default) in your application, while logging in, you need to have a

0 commit comments

Comments
 (0)