Skip to content

Commit b9a6db1

Browse files
committed
clear multiple common files
1 parent 7f35172 commit b9a6db1

54 files changed

Lines changed: 1202 additions & 1292 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/sdk/mobile/pnp/android/initialize.mdx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ description: "Web3Auth PnP Android SDK - Initialize | Documentation - Web3Auth"
55
---
66

77
import Initialization from "@site/src/common/sdk/pnp/android/_initialize.mdx";
8-
import SetResultUrl from "@site/src/common/sdk/pnp/android/_set-result-url.mdx";
98

109
import TabItem from "@theme/TabItem";
1110
import Tabs from "@theme/Tabs";
@@ -82,7 +81,17 @@ data class Web3AuthOptions(
8281

8382
## Set Result URL
8483

85-
<SetResultUrl />
84+
Whenever user initiates a login flow, a new intent of CustomTabs is launched. It's necessary step to
85+
use `setResultUrl` in `onNewIntent` method to successful track the login process.
86+
87+
```kotlin
88+
override fun onNewIntent(intent: Intent?) {
89+
super.onNewIntent(intent)
90+
91+
// Handle user signing in when app is active
92+
web3Auth.setResultUrl(intent.data)
93+
}
94+
```
8695

8796
## Triggering Login exceptions
8897

docs/sdk/mobile/pnp/android/install.mdx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import Installation from "@site/src/common/sdk/pnp/android/_installation.mdx";
99
import AndroidPermissions from "@site/src/common/sdk/pnp/android/_android-permissions.mdx";
1010
import Whitelist from "@site/src/common/sdk/pnp/android/_android-whitelist.mdx";
1111
import Deeplinking from "@site/src/common/sdk/pnp/android/_android-deep-linking.mdx";
12-
import ManifestChanges from "@site/src/common/sdk/pnp/android/_android-manifest-changes.mdx";
1312

1413
## Requirements
1514

@@ -31,7 +30,28 @@ Then, in your app-level `build.gradle` dependencies section, add the following:
3130

3231
## Configure AndroidManifest File
3332

34-
<ManifestChanges />
33+
Make sure your Main activity launchMode is set to **singleTop** in your `AndroidManifest.xml`
34+
35+
```xml
36+
<activity
37+
android:launchMode="singleTop"
38+
android:name=".YourActivity">
39+
// ...
40+
</activity>
41+
```
42+
43+
From version **7.1.2**, please make sure to set `android:allowBackup` to `false`, and add
44+
`tools:replace="android:fullBackupContent"` in your `AndroidManifest.xml` file.
45+
46+
```xml
47+
<application
48+
android:allowBackup="false"
49+
tools:replace="android:fullBackupContent"
50+
android:dataExtractionRules="@xml/data_extraction_rules"
51+
android:fullBackupContent="@xml/backup_rules"
52+
android:icon="@mipmap/ic_launcher">
53+
</application>
54+
```
3555

3656
## Configuration Redirection
3757

docs/sdk/mobile/pnp/android/usage.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ description: "Web3Auth PnP Android SDK - Usage | Documentation - Web3Auth"
77
import TabItem from "@theme/TabItem";
88
import Tabs from "@theme/Tabs";
99
import AndroidResponse from "@site/src/common/sdk/pnp/_userinfo_response.mdx";
10-
import LogOut from "@site/src/common/sdk/pnp/android/_logout.mdx";
1110
import SMSPasswordless from "@site/src/common/sdk/pnp/android/_sms_passwordless.mdx";
1211
import EnableMFAMethod from "@site/src/common/sdk/pnp/android/_enable-mfa.mdx";
1312

@@ -400,7 +399,12 @@ val web3Auth = Web3Auth(
400399

401400
## Logging out a user
402401

403-
<LogOut />
402+
Logging out your user is as simple as calling the `logout` method. This method will clear the
403+
session data and the user will be logged out from Web3Auth.
404+
405+
```kotlin
406+
val logoutCompletableFuture = web3Auth.logout()
407+
```
404408

405409
## Enable MFA for a user
406410

docs/sdk/mobile/pnp/flutter/initialize.mdx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ sidebar_label: Initialize
44
description: "Web3Auth PnP Flutter SDK - Initialization | Documentation - Web3Auth"
55
---
66

7-
import Initialization from "@site/src/common/sdk/pnp/flutter/_initialization.mdx";
8-
97
import TabItem from "@theme/TabItem";
108
import Tabs from "@theme/Tabs";
119

@@ -105,7 +103,30 @@ class Web3AuthOptions {
105103

106104
### Configure Web3AuthFlutter
107105

108-
<Initialization />
106+
```dart
107+
Future<void> initWeb3Auth() async {
108+
109+
late final Uri redirectUrl;
110+
111+
if (Platform.isAndroid) {
112+
redirectUrl = Uri.parse('{SCHEME}://{HOST}/auth');
113+
// w3a://com.example.w3aflutter/auth
114+
} else {
115+
redirectUrl = Uri.parse('{bundleId}://auth');
116+
// com.example.w3aflutter://auth
117+
}
118+
119+
// focus-start
120+
121+
await Web3AuthFlutter.init(Web3AuthOptions(
122+
clientId: "WEB3AUTH_CLIENT_ID",
123+
network: Network.sapphire_mainnet,
124+
redirectUrl: redirectUrl,
125+
));
126+
127+
// focus-end
128+
}
129+
```
109130

110131
## Triggering Login exceptions
111132

docs/sdk/mobile/pnp/flutter/install.mdx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ description: "Installing Web3Auth PnP Flutter SDK | Documentation - Web3Auth"
66

77
import FlutterInstallation from "@site/src/common/sdk/pnp/flutter/_installation.mdx";
88

9-
import AndroidCompileSDKVersion from "@site/src/common/sdk/pnp/android/_update-compile-sdk-version.mdx";
109
import UpdateGradle from "@site/src/common/sdk/pnp/android/_update-gradle.mdx";
1110
import AndroidPermission from "@site/src/common/sdk/pnp/android/_android-permissions.mdx";
1211
import AndroidDeepLinking from "@site/src/common/sdk/pnp/android/_android-deep-linking.mdx";
1312
import AndroidWhitelist from "@site/src/common/sdk/pnp/android/_android-whitelist.mdx";
1413

15-
import IOSPlatform from "@site/src/common/sdk/pnp/ios/_ios-platform.mdx";
1614
import SPM from "@site/src/common/sdk/pnp/ios/_spm.mdx";
1715
import Cocoapods from "@site/src/common/sdk/pnp/ios/_cocoapods.mdx";
1816
import IOSWhitelist from "@site/src/common/sdk/pnp/ios/ios-whitelist.mdx";
@@ -32,7 +30,17 @@ Once we have installed Web3Auth Flutter SDK, we also need to add the configurati
3230

3331
### Update compileSdkVersion
3432

35-
<AndroidCompileSDKVersion />
33+
For Android build `compileSdkVersion` needs to be `34`. Check your app module gradle file in your
34+
project to change it.
35+
36+
```groovy
37+
android {
38+
namespace "com.example.app_name"
39+
// focus-next-line
40+
compileSdkVersion 34
41+
// ..
42+
}
43+
```
3644

3745
### Add Web3Auth to Gradle
3846

@@ -61,7 +69,12 @@ Once we have configured the Android SDK, we also need add the configuration for
6169

6270
### Update global iOS platform
6371

64-
<IOSPlatform />
72+
For iOS build global platform needs to be 14.0. Check `Podfile` in your project to change the global
73+
platform.
74+
75+
```
76+
platform :ios, '14.0'
77+
```
6578

6679
### Configure Redirection
6780

docs/sdk/mobile/pnp/react-native/account-abstraction.mdx

Lines changed: 100 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ import ConfigureBundler from "@site/src/common/sdk/pnp/web/_bundler-configuratio
1414
import ConfigureSponsoredPaymaster from "@site/src/common/sdk/pnp/web/_sponsored-paymaster-configuration.mdx";
1515
import ConfigureERC20Paymaster from "@site/src/common/sdk/pnp/web/_erc20-paymaster-configuration.mdx";
1616

17-
import AARNBareSetup from "@site/src/common/sdk/pnp/react-native/_aa-rn-setup.mdx";
18-
import AARNExpoSetup from "@site/src/common/sdk/pnp/react-native/_aa-rn-expo-setup.mdx";
1917
import ConfigureSigners from "@site/src/common/sdk/pnp/web/_configure-aa-signers.mdx";
2018
import SmartAccountAddress from "@site/src/common/sdk/pnp/web/_aa-address.mdx";
2119
import SmartAccountSendTransaction from "@site/src/common/sdk/pnp/web/_aa-send-transaction.mdx";
@@ -74,12 +72,110 @@ token for ERC-20 paymasters, defining gas policies, and more.
7472
>
7573
<TabItem value="rn-bare" default>
7674

77-
<AARNBareSetup />
75+
```ts
76+
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";
77+
// focus-start
78+
import {
79+
AccountAbstractionProvider,
80+
SafeSmartAccount,
81+
} from "@web3auth/account-abstraction-provider";
82+
//focus-end
83+
import Web3Auth, { WEB3AUTH_NETWORK } from "@web3auth/react-native-sdk";
84+
import * as WebBrowser from "@toruslabs/react-native-web-browser";
85+
import EncryptedStorage from "react-native-encrypted-storage";
86+
import { CHAIN_NAMESPACES } from "@web3auth/base";
87+
88+
const chainConfig = {
89+
chainNamespace: CHAIN_NAMESPACES.EIP155,
90+
chainId: "0xaa36a7",
91+
rpcTarget: "https://rpc.sepolia.org",
92+
displayName: "Ethereum Sepolia Testnet",
93+
blockExplorerUrl: "https://sepolia.etherscan.io",
94+
ticker: "ETH",
95+
tickerName: "Ethereum",
96+
logo: "https://cryptologos.cc/logos/ethereum-eth-logo.png",
97+
};
98+
99+
// focus-start
100+
const accountAbstractionProvider = new AccountAbstractionProvider({
101+
config: {
102+
chainConfig,
103+
bundlerConfig: {
104+
// Get the pimlico API Key from dashboard.pimlico.io
105+
url: `https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey}`,
106+
},
107+
smartAccountInit: new SafeSmartAccount(),
108+
},
109+
});
110+
// focus-end
111+
112+
const privateKeyProvider = new EthereumPrivateKeyProvider({
113+
config: { chainConfig },
114+
});
115+
116+
const web3auth = new Web3Auth(WebBrowser, EncryptedStorage, {
117+
clientId,
118+
redirectUrl,
119+
network: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET, // or other networks
120+
privateKeyProvider,
121+
// focus-next-line
122+
accountAbstractionProvider: aaProvider,
123+
});
124+
```
78125

79126
</TabItem>
80127
<TabItem value="rn-expo">
81128

82-
<AARNExpoSetup />
129+
```ts
130+
import { EthereumPrivateKeyProvider } from "@web3auth/ethereum-provider";
131+
// focus-start
132+
import {
133+
AccountAbstractionProvider,
134+
SafeSmartAccount,
135+
} from "@web3auth/account-abstraction-provider";
136+
//focus-end
137+
import Web3Auth, { WEB3AUTH_NETWORK } from "@web3auth/react-native-sdk";
138+
import * as WebBrowser from "expo-web-browser";
139+
import * as SecureStore from "expo-secure-store";
140+
import { CHAIN_NAMESPACES } from "@web3auth/base";
141+
142+
const chainConfig = {
143+
chainNamespace: CHAIN_NAMESPACES.EIP155,
144+
chainId: "0xaa36a7",
145+
rpcTarget: "https://rpc.sepolia.org",
146+
displayName: "Ethereum Sepolia Testnet",
147+
blockExplorerUrl: "https://sepolia.etherscan.io",
148+
ticker: "ETH",
149+
tickerName: "Ethereum",
150+
logo: "https://cryptologos.cc/logos/ethereum-eth-logo.png",
151+
};
152+
153+
// focus-start
154+
const accountAbstractionProvider = new AccountAbstractionProvider({
155+
config: {
156+
chainConfig,
157+
bundlerConfig: {
158+
// Get the pimlico API Key from dashboard.pimlico.io
159+
url: `https://api.pimlico.io/v2/11155111/rpc?apikey=${pimlicoAPIKey}`,
160+
},
161+
smartAccountInit: new SafeSmartAccount(),
162+
},
163+
});
164+
// focus-end
165+
166+
const privateKeyProvider = new EthereumPrivateKeyProvider({
167+
config: { chainConfig },
168+
});
169+
170+
const web3auth = new Web3Auth(WebBrowser, SecureStore, {
171+
clientId,
172+
redirectUrl,
173+
network: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET, // or other networks
174+
privateKeyProvider,
175+
// focus-next-line
176+
accountAbstractionProvider: aaProvider,
177+
});
178+
```
83179

84180
</TabItem>
85181
</Tabs>

docs/sdk/mobile/pnp/react-native/usage.mdx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ sidebar_label: Usage
44
description: "Web3Auth PnP React Native SDK - Usage | Documentation - Web3Auth"
55
---
66

7-
import RNResponse from "@site/src/common/sdk/pnp/react-native/_get-user-info.mdx";
8-
import PrivateKey from "@site/src/common/sdk/pnp/react-native/_get-priv-key.mdx";
9-
import ED25519Key from "@site/src/common/sdk/pnp/react-native/_get-ed25519-priv-key.mdx";
107
import ChainConfig from "@site/src/common/sdk/pnp/web/_chain-config.mdx";
118
import TabItem from "@theme/TabItem";
129
import Tabs from "@theme/Tabs";
@@ -247,7 +244,21 @@ in the web3auth instance.
247244
const userInfo = web3auth.userInfo();
248245
```
249246

250-
<RNResponse />
247+
```json
248+
{
249+
"aggregateVerifier": "tkey-google",
250+
"email": "john@gmail.com",
251+
"name": "John Dash",
252+
"profileImage": "https://lh3.googleusercontent.com/a/Ajjjsdsmdjmnm...",
253+
"typeOfLogin": "google",
254+
"verifier": "torus",
255+
"verifierId": "john@gmail.com",
256+
"dappShare": "<24 words seed phrase>", // will be sent only incase of custom verifiers
257+
"idToken": "<jwtToken issued by Web3Auth>",
258+
"oAuthIdToken": "<jwtToken issued by OAuth Provider>", // will be sent only incase of custom verifiers
259+
"oAuthAccessToken": "<accessToken issued by OAuth Provider>" // will be sent only incase of custom verifiers
260+
}
261+
```
251262

252263
## Getting the `secp256k1` private key
253264

@@ -259,7 +270,9 @@ Using the `privKey()` method in the web3auth instance you can get the `secp256k1
259270
const privateKey = web3auth.privKey();
260271
```
261272

262-
<PrivateKey />
273+
```string
274+
"0ajjsdsd...."
275+
```
263276

264277
## Getting the `ed25519` private key
265278

@@ -271,7 +284,9 @@ Using the `ed25519Key()` method in the web3auth instance you can get the `ed2551
271284
const ed25519Key = web3auth.ed25519Key();
272285
```
273286

274-
<ED25519Key />
287+
```string
288+
"666523652352635...."
289+
```
275290

276291
## Enabling MFA
277292

0 commit comments

Comments
 (0)