diff --git a/apps/portal/src/app/bridge/buy-widget/iframe/iframe-code-preview.tsx b/apps/portal/src/app/bridge/buy-widget/iframe/iframe-code-preview.tsx
new file mode 100644
index 00000000000..5b2375bb4d9
--- /dev/null
+++ b/apps/portal/src/app/bridge/buy-widget/iframe/iframe-code-preview.tsx
@@ -0,0 +1,36 @@
+import { CodeBlock, Tabs, TabsContent, TabsList, TabsTrigger } from "@doc";
+
+export function IframeCodePreview(props: { src: string }) {
+ const includesImage = props.src.includes("image=");
+ const height = includesImage ? "850px" : "700px";
+ return (
+
+
+ Code
+ Preview
+
+
+ `}
+ lang="html"
+ />
+
+
+
+
+
+ );
+}
diff --git a/apps/portal/src/app/bridge/buy-widget/iframe/page.mdx b/apps/portal/src/app/bridge/buy-widget/iframe/page.mdx
new file mode 100644
index 00000000000..28794cc5440
--- /dev/null
+++ b/apps/portal/src/app/bridge/buy-widget/iframe/page.mdx
@@ -0,0 +1,168 @@
+import {
+ ArticleIconCard,
+ Details,
+ createMetadata,
+} from "@doc";
+import { IframeCodePreview } from "./iframe-code-preview";
+import { PlayIcon } from "lucide-react";
+
+export const metadata = createMetadata({
+ image: {
+ title: "Buy widget iframe",
+ icon: "payments",
+ },
+ title: "Buy widget iframe",
+ description: "Add a widget to let users buy crypto in your app using an iframe",
+});
+
+# Buy widget iframe
+
+The Buy widget iframe makes it easy for users to purchase crypto tokens in your app. Just add an iframe to your HTML and get a fully customizable buy widget - no build setup required.
+
+## Features
+
+- Purchase crypto tokens with fiat (credit/debit cards)
+- Cross-chain token swaps across 90+ blockchains
+- Display product information (title, description, image)
+- Customizable UI with dark and light mode support
+- Display fiat values in multiple currencies
+
+
+### Example
+
+
+
+
+
+## Try it out
+
+
+
+## Options
+
+You can customize the buy widget using query parameters as mentioned below.
+
+
+### Theme
+
+By default the widget uses the "dark" theme. You can set the light theme by passing the `theme=light` query parameter.
+
+
+
+
+### Product Information
+
+You can display product information by passing `title`, `description`, and `image` query parameters. Each of these parameters are optional.
+
+Make sure to URI encode the parameters if they contain special characters.
+
+
+
+* title: `"Something"`
+* description: `"Description of something goes here"`
+* image: `"https://picsum.photos/600/300"`
+* price: 0.01 ETH on Base
+
+
+
+
+
+
+### Currency
+
+By default the fiat value of the token amounts is displayed in USD. You can change the currency by setting the `currency` query parameter.
+
+
+
+- `USD` - US Dollar (default)
+- `EUR` - Euro
+- `GBP` - British Pound
+- `JPY` - Japanese Yen
+- `KRW` - Korean Won
+- `CNY` - Chinese Yuan
+- `INR` - Indian Rupee
+- `NOK` - Norwegian Krone
+- `SEK` - Swedish Krona
+- `CHF` - Swiss Franc
+- `AUD` - Australian Dollar
+- `CAD` - Canadian Dollar
+- `NZD` - New Zealand Dollar
+- `MXN` - Mexican Peso
+- `BRL` - Brazilian Real
+- `CLP` - Chilean Peso
+- `CZK` - Czech Koruna
+- `DKK` - Danish Krone
+- `HKD` - Hong Kong Dollar
+- `HUF` - Hungarian Forint
+- `IDR` - Indonesian Rupiah
+- `ILS` - Israeli New Sheqel
+- `ISK` - Icelandic Krona
+
+
+
+#### Example
+
+Show fiat values in Euro (EUR) in the widget.
+
+
+
+### Payment Methods
+
+By default, the widget enables both crypto and card (fiat) payment methods.
+
+You can customize which payment methods are available by setting the `paymentMethods` query parameter.
+
+Accepted values:
+- `crypto` - Enable crypto payments only
+- `card` - Enable card (fiat) payments only
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+### thirdweb branding
+
+By default, the widget displays thirdweb branding at the bottom. You can hide this by setting the `showThirdwebBranding` query parameter to `false`.
+
+
+
+## Listening for Events
+
+The buy widget iframe sends events to the parent window using `postMessage` when a purchase succeeds or fails.
+
+You can listen for these events to handle the purchase result in your application.
+
+```js
+window.addEventListener("message", (event) => {
+
+ // verify that message is from thirdweb buy widget iframe
+ if (
+ event.origin === "https://thirdweb.com" && event.data.source === "buy-widget"
+ ) {
+
+ if (event.data.type === "success") {
+ console.log("Purchase successful!");
+ }
+
+ if (event.data.type === "error") {
+ console.error("Purchase failed with error:", event.data.message);
+ }
+ }
+
+});
+```
+
diff --git a/apps/portal/src/app/bridge/buy-widget/page.mdx b/apps/portal/src/app/bridge/buy-widget/page.mdx
new file mode 100644
index 00000000000..d475864dfb5
--- /dev/null
+++ b/apps/portal/src/app/bridge/buy-widget/page.mdx
@@ -0,0 +1,61 @@
+import {
+ Details,
+ createMetadata,
+ DocImage,
+} from "@doc";
+import { ArticleIconCard } from "@doc";
+import { FrameIcon, PlayIcon } from "lucide-react";
+import { ReactIcon } from "@/icons";
+
+export const metadata = createMetadata({
+ image: {
+ title: "Buy widget",
+ icon: "payments",
+ },
+ title: "Buy widget",
+ description: "Add a widget to let users buy crypto in your app",
+});
+
+# Buy widget
+
+The Buy widget makes it easy for users to purchase crypto tokens in your app. It supports both fiat payments (credit/debit cards) and crypto payments, with cross-chain support across 90+ blockchains.
+
+## Features
+
+- Purchase crypto tokens with fiat (credit/debit cards)
+- Cross-chain token swaps across 90+ blockchains
+- Display product information (title, description, image)
+- Customizable UI with dark and light mode support
+- Display fiat values in multiple currencies
+
+## Get Started
+
+You can integrate the buy widget into your website using an iframe or a React component.
+
+
+
+## Try it out
+
+
+
diff --git a/apps/portal/src/app/bridge/buy-widget/react/page.mdx b/apps/portal/src/app/bridge/buy-widget/react/page.mdx
new file mode 100644
index 00000000000..eb9bec6e5bb
--- /dev/null
+++ b/apps/portal/src/app/bridge/buy-widget/react/page.mdx
@@ -0,0 +1,127 @@
+import {
+ ArticleIconCard,
+ createMetadata,
+} from "@doc";
+import { PlayIcon } from "lucide-react";
+import { ReactIcon } from "@/icons";
+
+export const metadata = createMetadata({
+ image: {
+ title: "Buy widget component",
+ icon: "payments",
+ },
+ title: "Buy widget component",
+ description: "Add a widget to let users buy crypto in your app using a React component",
+});
+
+# Buy widget component
+
+The Buy widget component makes it easy for users to purchase crypto tokens in your app
+
+## Features
+
+- Purchase crypto tokens with fiat (credit/debit cards)
+- Cross-chain token swaps across 90+ blockchains
+- Display product information (title, description, image)
+- Customizable UI with dark and light mode support
+- Display fiat values in multiple currencies
+
+## Example
+
+You will need a thirdweb project client id to use the `BuyWidget` component. You can get your clientId by creating a project in the [thirdweb dashboard](https://thirdweb.com/team).
+
+```tsx
+import { BuyWidget } from "thirdweb/react";
+import { createThirdwebClient } from "thirdweb";
+import { base } from "thirdweb/chains";
+
+const client = createThirdwebClient({
+ clientId: "YOUR_THIRDWEB_CLIENT_ID",
+});
+
+function Example() {
+ return (
+
+ );
+}
+```
+
+Make sure to wrap the component containing `BuyWidget` with the `ThirdwebProvider` component.
+
+```tsx
+import { ThirdwebProvider } from "thirdweb/react";
+
+function App() {
+ return (
+
+
+
+ );
+}
+```
+
+### Prefill a specific token
+
+You can prefill the widget with a specific token by passing the `tokenAddress` prop.
+
+```tsx
+import { BuyWidget } from "thirdweb/react";
+import { base } from "thirdweb/chains";
+
+function Example() {
+ return (
+
+ );
+}
+```
+
+### Send to a specific address
+
+By default, the connected wallet address receives the purchased tokens.
+
+You can set `receiverAddress` prop to send the purchased tokens to a different address.
+
+```tsx
+import { BuyWidget } from "thirdweb/react";
+import { base } from "thirdweb/chains";
+
+function Example() {
+ return (
+
+ );
+}
+```
+
+## API Reference
+
+
+
+## Try it out
+
+
+
diff --git a/apps/portal/src/app/bridge/sidebar.tsx b/apps/portal/src/app/bridge/sidebar.tsx
index f26740aed07..76c3b6b397f 100644
--- a/apps/portal/src/app/bridge/sidebar.tsx
+++ b/apps/portal/src/app/bridge/sidebar.tsx
@@ -41,29 +41,43 @@ export const sidebar: SideBar = {
],
},
{
- name: "Checkout Widget",
- href: `${bridgeSlug}/checkout-widget`,
+ name: "Swap Widget",
+ href: `${bridgeSlug}/swap-widget`,
links: [
{
- href: `${bridgeSlug}/checkout-widget/react`,
+ href: `${bridgeSlug}/swap-widget/react`,
name: "React Component",
},
{
- href: `${bridgeSlug}/checkout-widget/iframe`,
+ href: `${bridgeSlug}/swap-widget/iframe`,
name: "Iframe",
},
],
},
{
- name: "Swap Widget",
- href: `${bridgeSlug}/swap-widget`,
+ name: "Buy Widget",
+ href: `${bridgeSlug}/buy-widget`,
links: [
{
- href: `${bridgeSlug}/swap-widget/react`,
+ href: `${bridgeSlug}/buy-widget/react`,
name: "React Component",
},
{
- href: `${bridgeSlug}/swap-widget/iframe`,
+ href: `${bridgeSlug}/buy-widget/iframe`,
+ name: "Iframe",
+ },
+ ],
+ },
+ {
+ name: "Checkout Widget",
+ href: `${bridgeSlug}/checkout-widget`,
+ links: [
+ {
+ href: `${bridgeSlug}/checkout-widget/react`,
+ name: "React Component",
+ },
+ {
+ href: `${bridgeSlug}/checkout-widget/iframe`,
name: "Iframe",
},
],