Skip to content

Commit ccb4873

Browse files
docs: Reorganize TypeScript and React documentation structure
1 parent f6d5d10 commit ccb4873

File tree

12 files changed

+398
-426
lines changed

12 files changed

+398
-426
lines changed

apps/portal/src/app/connect/wallet/sign-in-methods/configure/page.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,19 +113,19 @@ Most authentication option are that straight forward. However, some options requ
113113

114114
<div className="flex flex-col space-y-4">
115115
<ArticleIconCard
116-
href="/wallet/sign-in-methods/guest"
116+
href="/connect/wallet/sign-in-methods/guest"
117117
icon={UserIcon}
118118
title="Guest Mode"
119119
description="Learn more about guest mode"
120120
/>
121121
<ArticleIconCard
122-
href="/wallet/sign-in-methods/external-wallets"
122+
href="/connect/wallet/sign-in-methods/external-wallets"
123123
icon={WalletsConnectIcon}
124124
title="External Wallet"
125125
description="Learn more about external wallet authentication"
126126
/>
127127
<ArticleIconCard
128-
href="/wallet/sign-in-methods/custom-auth/overview"
128+
href="/connect/in-app-wallet/custom-auth/configuration"
129129
icon={EcosystemWalletsIcon}
130130
title="Custom Authentication"
131131
description="Learn more about custom authentication with your own auth system"

apps/portal/src/app/react/v5/connecting-wallets/hooks/page.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function Example() {
4848

4949
You can create any wallet by id with auto completion using the [`createWallet`](/references/typescript/v5/createWallet) function. Or use one of the first party wallets like [`inAppWallet`](/references/typescript/v5/inAppWallet) or [`ecosystemWallet`](/references/typescript/v5/ecosystemWallet).
5050

51+
<Stack>
5152
<ArticleIconCard
5253
title="inAppWallet"
5354
icon={Wallet}
@@ -68,7 +69,7 @@ You can create any wallet by id with auto completion using the [`createWallet`](
6869
href="/references/typescript/v5/createWallet"
6970
description="Create any external wallet by id with auto completion"
7071
/>
71-
72+
</Stack>
7273
## Pre Connection Hooks
7374

7475
Use these hooks to trigger and manage wallet wallet connection within your own UI. Refer to [wallet connection hooks reference](/references/typescript/v5/useConnect) for more information.

apps/portal/src/app/react/v5/in-app-wallet/get-started/page.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
Step
1414
} from "@doc";
1515
import {ExternalLink} from "lucide-react";
16-
import ConnectWalletHero from "./connect-wallet-hero.webp";
1716

1817
export const metadata = createMetadata({
1918
title: "Connect users with In-App Wallet",

apps/portal/src/app/react/v5/sidebar.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Book, CodeIcon, ExternalLink, ZapIcon } from "lucide-react";
1+
import { CodeIcon, ExternalLink, ZapIcon } from "lucide-react";
22
import type { SideBar } from "../../../components/Layouts/DocLayout";
33

44
const slug = "/react/v5";
@@ -137,22 +137,15 @@ export const sidebar: SideBar = {
137137
isCollapsible: false,
138138
links: [
139139
{
140-
name: "Adapters",
141-
links: [
142-
{
143-
// TODO one guide per library
144-
name: "Usage with other libraries",
145-
icon: <Book />,
146-
href: `${slug}/adapters`,
147-
},
148-
],
140+
// TODO one guide per library
141+
name: "Usage with other libraries",
142+
href: `${slug}/adapters`,
149143
},
150144
{
151145
name: "Shared Logins",
152146
links: ["SiteEmbed", "SiteLink"].map((name) => ({
153147
name,
154148
href: `${slug}/${name}`,
155-
icon: <CodeIcon />,
156149
})),
157150
},
158151
],
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import {
2+
Tabs,
3+
TabsList,
4+
TabsTrigger,
5+
TabsContent,
6+
Callout,
7+
DocImage,
8+
createMetadata,
9+
ArticleIconCard,
10+
Stack,
11+
AuthList,
12+
} from "@doc";
13+
import { ExternalLink} from "lucide-react";
14+
import EcosystemSocialConfig from './social-config.png'
15+
import { TypeScriptIcon } from "@/icons";
16+
17+
export const metadata = createMetadata({
18+
title: "Connect users with Ecosystem Wallets",
19+
description:
20+
"Connect users with ecosystem wallets",
21+
image: {
22+
title: "Connect users with Ecosystem Wallets",
23+
icon: "wallets",
24+
},
25+
});
26+
27+
# Connect Users to your Ecosystem
28+
29+
Ecosystem wallets inherit all the functionality of [in-app wallets](/references/typescript/v5/in-app-wallet), but instead of being scoped to a single app, they can be used across multiple applications.
30+
31+
Head over to the [thirdweb dashboard](https://thirdweb.com/team) to create an ecosystem and obtain your ecosystem id.
32+
33+
## Available auth methods
34+
35+
<AuthList />
36+
37+
## Live Playground
38+
39+
Try out ecosystem wallets for yourself in the [in-app wallet live playground](https://playground.thirdweb.com/connect/in-app-wallet/ecosystem)
40+
41+
<Stack>
42+
43+
<ArticleIconCard
44+
title="Try the demo"
45+
icon={ExternalLink}
46+
href="https://playground.thirdweb.com/connect/in-app-wallet/ecosystem"
47+
description="See the SDK in action on the live playground"
48+
/>
49+
50+
</Stack>
51+
52+
## Configure ecosystem wallets
53+
54+
The only difference with in-app wallets is how you create an ecosystem wallet using the `ecosystemWallet()` function and passing your ecosystem id.
55+
56+
```tsx
57+
import { ecosystemWallet } from "thirdweb/wallets";
58+
59+
const wallet = ecosystemWallet("ecosystem.your-ecosystem-id");
60+
```
61+
62+
## Configuring auth strategies
63+
64+
You can configure the allowed auth strategies on [your dashboard](https://thirdweb.com/team/~/~/ecosystem).
65+
66+
<DocImage src={EcosystemSocialConfig}/>
67+
68+
For prebuilt UIs, the enabled auth strategies are automatically read from your dashbaord configurations.
69+
70+
For custom UIs, you can configure the auth options when connecting the wallet. See [using your own UI](#using-your-own-ui) for an example.
71+
72+
<Callout variant="warning" title="Using disabled auth strategies">
73+
Note that while you're allowed to pass any auth strategy today, we recommend only passing the strategies that are enabled on your dashboard. We might enforce this in the future.
74+
</Callout>
75+
76+
## Passing a partner ID
77+
78+
For closed ecosystems, you can invite partners to your ecosystem. Partners will have to pass a valid `partnerId` to the `ecosystemWallet()` function in order to connect to your ecosystem.
79+
80+
```tsx
81+
const wallet = ecosystemWallet("ecosystem.your-ecosystem-id", {
82+
partnerId: "your-partner-id",
83+
});
84+
```
85+
86+
For more information, refer to the [ecosystemWallet API reference](/references/typescript/v5/ecosystemWallet).
87+
88+
<Stack>
89+
90+
<ArticleIconCard
91+
title="ecosystemWallet API reference"
92+
icon={TypeScriptIcon}
93+
href="/references/typescript/v5/ecosystemWallet"
94+
description="Learn more about the ecosystemWallet function"
95+
/>
96+
97+
</Stack>
98+
99+
## Using ecosystem wallets
100+
101+
Refer to the [in-app wallets](/references/typescript/v5/in-app-wallet) documentation to add your ecosystem wallet to your applications.
161 KB
Loading
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
import {
2+
Tabs,
3+
TabsList,
4+
TabsTrigger,
5+
TabsContent,
6+
Callout,
7+
DocImage,
8+
createMetadata,
9+
AuthList,
10+
ArticleIconCard,
11+
Stack,
12+
Steps,
13+
Step
14+
} from "@doc";
15+
import {ExternalLink} from "lucide-react";
16+
import { TypeScriptIcon } from "@/icons";
17+
18+
export const metadata = createMetadata({
19+
title: "Connect users with In-App Wallet",
20+
description:
21+
"use the prebuilt connect UI components to authenticate users and connect in-app wallets",
22+
image: {
23+
title: "Connect users with In-App Wallets",
24+
icon: "wallets",
25+
},
26+
});
27+
28+
# In-App Wallets
29+
30+
Create in-app wallet for your users based on their email, phone, passkey, social auth or even their external wallets. These wallets are scoped by your clientId and do not require any confirmation to sign transactions.
31+
32+
## Available auth methods
33+
34+
<AuthList />
35+
36+
## Live Playground
37+
38+
Try out in-app wallets for yourself in the [in-app wallet live playground](https://playground.thirdweb.com/connect/in-app-wallet)
39+
40+
<Stack>
41+
42+
<ArticleIconCard
43+
title="Try the demo"
44+
icon={ExternalLink}
45+
href="https://playground.thirdweb.com/connect/in-app-wallet"
46+
description="See the SDK in action on the live playground"
47+
/>
48+
49+
</Stack>
50+
51+
## Configure in-app wallets
52+
53+
The simplest way to create an in-app wallet is to use the `inAppWallet()` function. By default, this will create a wallet that supports email/password login, Google, Apple, Facebook login, and passkey.
54+
55+
```tsx
56+
import { inAppWallet } from "thirdweb/wallets";
57+
58+
const wallet = inAppWallet();
59+
```
60+
61+
You can also customize the wallet by passing in options.
62+
63+
```tsx
64+
import { inAppWallet } from "thirdweb/wallets";
65+
66+
const wallet = inAppWallet({
67+
auth: {
68+
mode, // options are "popup" | "redirect" | "window";
69+
options, // ex: ["discord", "farcaster", "apple", "facebook", "google", "passkey"],
70+
passkeyDomain, // for passkey, the domain that the passkey is created on
71+
redirectUrl, // the URL to redirect to after authentication
72+
},
73+
metadata, // metadata for the wallet (name, icon, etc.)
74+
smartAccount, // smart account options for the wallet (for gasless tx)
75+
});
76+
```
77+
78+
[View all in-app wallet options](/references/typescript/v5/InAppWalletCreationOptions).
79+
80+
Once created, you can use it either with the prebuilt UI components, or with your own UI.
81+
82+
## Usage
83+
84+
```tsx
85+
import { ThirdwebProvider, ConnectButton } from "thirdweb/react";
86+
import { inAppWallet } from "thirdweb/wallets";
87+
88+
const client = createThirdwebClient({ clientId });
89+
const wallet = inAppWallet();
90+
91+
const account = await wallet.connect({
92+
client,
93+
strategy: "google",
94+
});
95+
96+
console.log("connected as", account.address);
97+
98+
```
99+
100+
## API Reference
101+
102+
View all the auth and configuration options for in-app wallets in the [API Reference](/references/typescript/v5/inAppWallet).
103+
104+
<Stack>
105+
106+
<ArticleIconCard
107+
title="inAppWallet"
108+
icon={TypeScriptIcon}
109+
href="/references/typescript/v5/inAppWallet"
110+
description="Create an in-app wallet from any auth"
111+
/>
112+
113+
</Stack>

0 commit comments

Comments
 (0)