diff --git a/apps/playground-web/src/app/connect/in-app-wallet/page.tsx b/apps/playground-web/src/app/connect/in-app-wallet/page.tsx
index 263ebb02778..64c94b3064a 100644
--- a/apps/playground-web/src/app/connect/in-app-wallet/page.tsx
+++ b/apps/playground-web/src/app/connect/in-app-wallet/page.tsx
@@ -1,4 +1,5 @@
import { CodeExample } from "@/components/code/code-example";
+import { CustomLoginForm } from "@/components/in-app-wallet/custom-login-form";
import { InAppConnectEmbed } from "../../../components/in-app-wallet/connect-button";
import { Profiles } from "../../../components/in-app-wallet/profile-sections";
import ThirdwebProvider from "../../../components/thirdweb-provider";
@@ -30,13 +31,16 @@ function AnyAuth() {
base.
-
- }
- code={`import { inAppWallet } from "thirdweb/wallets";
+
+
Prebuilt UI
+
+ Instant out of the box authentication with a prebuilt UI.
+
+
}
+ code={`import { inAppWallet } from "thirdweb/wallets";
import { ConnectEmbed } from "thirdweb/react";
-
const wallets = [
inAppWallet(
// built-in auth methods
@@ -66,8 +70,83 @@ function AnyAuth() {
return (
);
};`}
- lang="tsx"
- />
+ lang="tsx"
+ />
+
+
+
Custom Auth and UI
+
+ Customize the login UI and integrate with your existing user base. No
+ limits on customizations and auth methods.
+
+
+
+
+ }
+ code={`import { useMutation } from "@tanstack/react-query";
+import { useState } from "react";
+import { useConnect } from "thirdweb/react";
+import { inAppWallet } from "thirdweb/wallets";
+
+export function CustomLoginForm() {
+ const [email, setEmail] = useState("");
+ const { connect, isConnecting, error } = useConnect();
+
+ const { mutate: loginWithCustomAuth } = useMutation({
+ mutationFn: async (email: string) => {
+ const wallet = await connect(async () => {
+ const wallet = inAppWallet();
+ await wallet.connect({
+ strategy: "auth_endpoint",
+ client,
+ // your own custom auth payload here
+ payload: JSON.stringify({
+ userId: email,
+ email,
+ }),
+ });
+ return wallet;
+ });
+ return wallet;
+ }
+ });
+
+ const handleSubmit = (e: React.FormEvent) => {
+ e.preventDefault();
+ loginWithCustomAuth(email);
+ };
+
+ return (
+
+ );
+}
+`}
+ lang="tsx"
+ />
+
>
);
}
diff --git a/apps/playground-web/src/components/in-app-wallet/custom-login-form.tsx b/apps/playground-web/src/components/in-app-wallet/custom-login-form.tsx
new file mode 100644
index 00000000000..636e16b012b
--- /dev/null
+++ b/apps/playground-web/src/components/in-app-wallet/custom-login-form.tsx
@@ -0,0 +1,67 @@
+"use client";
+
+import { THIRDWEB_CLIENT } from "@/lib/client";
+import { useMutation } from "@tanstack/react-query";
+import { useState } from "react";
+import { useActiveAccount, useConnect } from "thirdweb/react";
+import { inAppWallet } from "thirdweb/wallets";
+import { InAppConnectEmbed } from "./connect-button";
+
+export function CustomLoginForm() {
+ const [email, setEmail] = useState("");
+ const { connect, isConnecting, error } = useConnect();
+ const account = useActiveAccount();
+
+ const { mutate: loginWithCustomAuthEndpoint } = useMutation({
+ mutationFn: async (email: string) => {
+ const wallet = await connect(async () => {
+ const wallet = inAppWallet();
+ await wallet.connect({
+ strategy: "auth_endpoint",
+ client: THIRDWEB_CLIENT,
+ payload: JSON.stringify({
+ userId: email,
+ email,
+ }),
+ });
+ return wallet;
+ });
+ return wallet;
+ },
+ });
+
+ const handleSubmit = (e: React.FormEvent) => {
+ e.preventDefault();
+ loginWithCustomAuthEndpoint(email);
+ };
+ if (account) {
+ return ;
+ }
+
+ return (
+
+ );
+}