-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #504 from Web3Auth/rn-docs-addition
Added migration guide, whitelabel, fixed minor typos - RN docs
- Loading branch information
Showing
9 changed files
with
202 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
title: PnP React Native - v4 to v5 | ||
displayed_sidebar: docs | ||
description: "PnP React Native SDK - v4 to v5 | Documentation - Web3Auth" | ||
--- | ||
|
||
import TabItem from "@theme/TabItem"; | ||
import Tabs from "@theme/Tabs"; | ||
|
||
## Changes to the `WhiteLabelData` object | ||
|
||
### Addition and modifications to parameters | ||
|
||
- With v5, when sending the whitelabel object while initialization, please keep in mind that the `name` parameter signifying the name of the app has | ||
been changed to `appName`. | ||
- The `dark` parameter that used to accept a boolean value to switch between dark or light mode has been changed to `mode` that accepts a string value | ||
of either `light` or `dark` or `auto`. | ||
- The `theme` parameter now accepts an object with key-value pairs, where the value corresponds to the color for a specific set of keys. | ||
- Other than the above modifications, new parameters have been added to the `WhiteLabelData` object, like, `appUrl`, `useLogoLoader`, `tncLink` and | ||
`privacyPolicy`. | ||
|
||
Please look at the [whitelabel](/sdk/pnp/react-native/whitelabel) section for `WhiteLabelData` interface. | ||
|
||
<Tabs | ||
defaultValue="expo" | ||
values={[ | ||
{ label: "Expo Managed Workflow", value: "expo" }, | ||
{ label: "Bare React Native Workflow", value: "bare" }, | ||
]} | ||
> | ||
|
||
<TabItem value="expo"> | ||
|
||
```tsx | ||
import * as WebBrowser from "expo-web-browser"; | ||
import * as SecureStore from "expo-secure-store"; | ||
import Web3Auth, { LOGIN_PROVIDER, OPENLOGIN_NETWORK } from "@web3auth/react-native-sdk"; | ||
|
||
const clientId = "YOUR WEB3AUTH CLIENT ID"; | ||
|
||
const web3auth = new Web3Auth(WebBrowser, SecureStore, { | ||
clientId, | ||
network: OPENLOGIN_NETWORK.TESTNET, // or other networks | ||
// highlight-start | ||
whiteLabel: { | ||
appName: "My App", | ||
logoLight: "https://web3auth.io/images/logo-light.png", | ||
logoDark: "https://web3auth.io/images/logo-dark.png", | ||
defaultLanguage: "en", | ||
mode: "auto", // or "dark" or "light" | ||
theme: { | ||
primary: "#cddc39", | ||
}, | ||
}, | ||
// highlight-end | ||
}); | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="bare"> | ||
|
||
```tsx | ||
import * as WebBrowser from "@toruslabs/react-native-web-browser"; | ||
import EncryptedStorage from "react-native-encrypted-storage"; | ||
import Web3Auth, { LOGIN_PROVIDER, OPENLOGIN_NETWORK } from "@web3auth/react-native-sdk"; | ||
|
||
const clientId = "YOUR WEB3AUTH CLIENT ID"; | ||
|
||
const web3auth = new Web3Auth(WebBrowser, EncryptedStorage, { | ||
clientId, | ||
network: OPENLOGIN_NETWORK.TESTNET, // or other networks | ||
// highlight-start | ||
whiteLabel: { | ||
appName: "My App", | ||
logoLight: "https://web3auth.io/images/logo-light.png", | ||
logoDark: "https://web3auth.io/images/logo-dark.png", | ||
defaultLanguage: "en", | ||
mode: "auto", // or "dark" or "light" | ||
theme: { | ||
primary: "#cddc39", | ||
}, | ||
}, | ||
// highlight-end | ||
}); | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
8b3da72
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
web3auth-docs – ./
w3a-docs.vercel.app
web3auth-docs-git-master-web3auth.vercel.app
web3auth-docs-web3auth.vercel.app