You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/connect/universal-bridge/layout.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ export default async function Layout(props: {
"Learn how to implement all-in-one web3 payment solution, Universal bridge: the technical step-by-step process",
21
+
"Learn how to implement cross-chain payments, bridging, and onramps with the Universal Bridge SDK",
19
22
});
20
23
21
24
# Get Started
22
25
23
-
Learn how to add onramps and crypto purchases to your application. To see which integration is right for you, refer to our [integrations overview](/connect/pay/overview#integration-options).
24
-
25
-
The following guide uses our React SDK. You can also learn how to integrate Universal Bridge with our [Unity SDK](https://portal.thirdweb.com/unity/pay/getbuywithcryptoquote).
26
+
Learn how to integrate Universal Bridge into your application for cross-chain payments, bridging, swapping, and fiat onramps. This guide covers the core SDK modules and practical implementation examples.
26
27
27
28
---
28
29
29
30
## Installation
30
31
31
32
<Steps>
32
-
<Steptitle="Install the Connect SDK">
33
+
<Steptitle="Install the SDK">
33
34
<InstallTabs
34
35
npm="npm i thirdweb"
35
36
yarn="yarn add thirdweb"
@@ -38,95 +39,260 @@ The following guide uses our React SDK. You can also learn how to integrate Univ
38
39
</Step>
39
40
<Steptitle="Get Your Client ID">
40
41
41
-
Log in to [the thirdweb dashboard](https://thirdweb.com/team). Navigate to the **Settings** page and create an API key to get your **Client ID**. You'll need your Client ID to interact with the Connect SDK.
42
+
Log in to [the thirdweb dashboard](https://thirdweb.com/team). Navigate to the **Settings** page and create an API key to get your **Client ID**. You'll need your Client ID to interact with the Universal Bridge.
43
+
44
+
</Step>
45
+
<Steptitle="Initialize the Client">
46
+
47
+
```typescript
48
+
import { createThirdwebClient } from"thirdweb";
49
+
50
+
const client =createThirdwebClient({
51
+
clientId: "your_client_id"
52
+
});
53
+
```
54
+
55
+
</Step>
56
+
<Steptitle="Prepare a Swap">
57
+
58
+
Get a quote and prepare your first cross-chain swap:
Universal Bridge is available by default with our `ConnectButton` component. When users log in with Connect, they'll be able to onramp and purchase crypto directly from the logged in Connect interface. You can read more about `ConnectButton`[in this guide](/connect/sign-in/ConnectButton).
**Best for:** Building route selectors, showing available options to users
225
+
226
+
</TabsContent>
227
+
228
+
</Tabs>
94
229
95
230
---
96
231
97
-
## Option 3: Send a Transaction with Pay
98
-
99
-
Universal Bridge is enabled by default for any contract call sent with `sendTransaction`. It will automatically be invoked when a user does not have enough funds to complete the transaction.
100
-
101
-
<Calloutvariant="info">
102
-
ℹ️ `sendTransaction` is available in [Connect SDK v5](/typescript/v5) or
When a user clicks this button, Universal Bridge will perform gas estimation to determine if the user has a sufficient balance. If their balance is sufficient, the transaction will execute normally. If their balance is not sufficient, the following modal will pop up asking them to either onramp funds or convert crypto to the required amount:
263
+
---
264
+
265
+
## Error Handling
266
+
267
+
Universal Bridge functions throw `ApiError` for failed requests:
Once a user onramps or converts their funds to the required token, the user will be prompted once more to confirm the transaction. The transaction will then execute as expected.
292
+
## Next Steps
131
293
132
-
For deeper customization of the Universal Bridge transaction modal, you can refer to our [sendTransaction customization guide](/connect/pay/customization/send-transaction).
294
+
-**[API Reference](https://bridge.thirdweb.com/reference)** - Complete REST API documentation
295
+
-**[SDK Reference](/typescript/v5/buy/quote)** - TypeScript SDK function reference
296
+
-**[Webhooks](/pay/webhooks)** - Set up real-time notifications
0 commit comments