Getting Started
To get started, install the required dependencies into your React Native project.
npx thirdweb install
This will detect the environment and install the required dependencies.
You will require an API key to use thirdweb's infrastructure services with the SDK. If you haven't created a key yet you can do so for free from the thirdweb dashboard.
Wrap Your Application in ThirdwebProvider
Wrap your application in the ThirdwebProvider
component to start using the SDK.
import { ThirdwebProvider } from "@thirdweb-dev/react-native";
const App = () => {
return (
<ThirdwebProvider activeChain="ethereum" clientId="your-client-id">
<YourApp />
</ThirdwebProvider>
);
};
Finally, we can run our app!
yarn android
yarn ios
Connect Wallets to your App
With the provider set up, you can now connect users to your application & Connect Wallet works out of the box!
import { SafeAreaView } from "react-native";
import { ConnectWallet } from "@thirdweb-dev/react-native";
const AppInner = () => {
return (
<SafeAreaView style={styles.backgroundStyle}>
<ConnectWallet />
</SafeAreaView>
);
};
View this page for details on the ConnectWallet
here.
Alternatively, create your own custom wallet connection using useConnect.
A list of the supported wallets can be found here. If the wallet is not supported, you can Create a Custom Wallet.