Docs

Custom auth with embeddedWallet - React Native

Mike Shin

New feature

You can now connect using your own custom JWT using thirdweb's embeddedWallet :

import {
embeddedWallet,
ThirdwebProvider,
useConnect,
} from "@thirdweb-dev/react-native";
import { Button } from "react-native";
import React from "react";
const App = () => {
return (
<ThirdwebProvider>
<AppInner />
</ThirdwebProvider>
);
};
const AppInner = () => {
const connect = useConnect();
const triggerConnect = async () => {
connect(embeddedWallet(), {
loginType: "jwt",
password: "strong-password",
jwt: "your-jwt-token",
});
};
return <Button title={"Connect with custom JWT"} onPress={triggerConnect} />;
};
```

Integrating embeddedWallet with our ThirdwebProvider

How to update

Update the @thirdweb-dev/react-native package to @thirdweb-dev/react-native@nightly and make sure to add the new package dependencies. For full setup notes, please visit our documentation.