Skip to content

[PRO-249] Portal: Update OG images #7664

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"private": true,
"scripts": {
"build": "next build",
"format": "biome format ./src --write",
"create-index": "pnpm tsx scripts/createEmptySearchIndex.ts",
"dev": "next dev",
"extract-llm-content": "pnpm tsx scripts/extractLLMData.ts",
Expand Down
Binary file modified apps/portal/public/og/background-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 0 additions & 51 deletions apps/portal/src/app/api/og/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,37 +64,6 @@ export async function GET(request: Request) {
width: "50%",
}}
>
<div
style={{
alignItems: "center",
display: "flex",
gap: "10px",
marginBottom: "40px",
}}
>
<img
alt=""
height={50 / 1.7}
src={`${BAST_URL}/icons/thirdweb-logo.svg`}
style={{
display: "flex",
}}
width={300 / 1.7}
/>

<div
style={{
color: "white",
fontFamily: "Inter",
fontSize: "26px",
fontWeight: 600,
marginTop: "2px",
}}
>
Docs
</div>
</div>

<div
style={{
display: "flex",
Expand All @@ -107,26 +76,6 @@ export async function GET(request: Request) {
>
{title}
</div>

<div
style={{
display: "flex",
}}
>
<div
style={{
background: "white",
borderRadius: "10px",
color: "black",
fontFamily: "Inter",
fontSize: "24px",
fontWeight: 600,
padding: "14px 20px",
}}
>
Read More
</div>
</div>
</div>

<img
Expand Down
4 changes: 4 additions & 0 deletions apps/portal/src/app/contracts/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ export const metadata = createMetadata({
title: "thirdweb Contracts",
description:
"Tools to easily create, deploy, and manage smart contracts on any EVM compatible blockchain.",
image: {
icon: "contract",
title: "thirdweb Contracts",
},
});

# What are Contracts?
Expand Down
6 changes: 3 additions & 3 deletions apps/portal/src/app/payments/custom-data/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import {

export const metadata = createMetadata({
image: {
title: "Payments",
icon: "pay",
title: "Custom Payment Data",
icon: "payments",
},
title: "Custom Payment Data",
description: "Pass custom app data to payments to be included on webhooks, payment history, and more.",
Expand Down Expand Up @@ -92,7 +92,7 @@ Associate user IDs, custom payment IDs, order details, and more with any payment
amount="0.1"
purchaseData={{
userId: "user-123",
orderId: "order-456",
orderId: "order-456",
productType: "wallet-funding",
metadata: {
source: "app",
Expand Down
2 changes: 1 addition & 1 deletion apps/portal/src/app/payments/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const metadata = createMetadata({
description:
"Monetize your app with thirdweb Payments. Sell products, transfer funds between users, launch tokens, and more.",
image: {
icon: "payment",
icon: "payments",
title: "thirdweb Payments Docs",
},
title: "thirdweb Payments Documentation",
Expand Down
4 changes: 2 additions & 2 deletions apps/portal/src/app/payments/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import {

export const metadata = createMetadata({
image: {
title: "Payments",
icon: "pay"
title: "Get started with Payments",
icon: "payments"
},
title: "Get started with Payments",
description: "Monetize your app with thirdweb Payments. Sell products, transfer funds between users, launch tokens, and more.",
Expand Down
6 changes: 3 additions & 3 deletions apps/portal/src/app/payments/products/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {

export const metadata = createMetadata({
image: {
title: "Payments",
icon: "pay",
title: "Sell a Product",
icon: "payments",
},
title: "Sell a Product",
description: "Accept any token as payment for your products.",
Expand Down Expand Up @@ -49,7 +49,7 @@ function ProductPage() {
<div>
<h1>Premium Course</h1>
<p>Complete guide to web3 development</p>

<CheckoutWidget
client={client}
chain={arbitrum}
Expand Down
4 changes: 2 additions & 2 deletions apps/portal/src/app/payments/routes/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { ExternalLink } from "lucide-react";

export const metadata = createMetadata({
image: {
title: "Payments",
icon: "pay",
title: "Find Routes",
icon: "payments",
},
title: "Find Routes",
description: "Find available routes for bridging, swapping, and paying.",
Expand Down
4 changes: 2 additions & 2 deletions apps/portal/src/app/payments/sell/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import {

export const metadata = createMetadata({
image: {
title: "Payments",
icon: "pay",
title: "Sell Tokens",
icon: "payments",
},
title: "Sell Tokens",
description: "Learn how to sell tokens with thirdweb Payments.",
Expand Down
8 changes: 4 additions & 4 deletions apps/portal/src/app/payments/send/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { ExternalLink } from "lucide-react";

export const metadata = createMetadata({
image: {
title: "Payments",
icon: "pay",
title: "Send a payment",
icon: "payments",
},
title: "Send a payment",
description: "Learn how to send a payment between users with thirdweb Payments.",
Expand All @@ -48,7 +48,7 @@ Send a payment between users using any combination of chains or tokens. thirdweb

```typescript
import { Bridge } from "thirdweb";

const preparedQuote = await Bridge.Buy.prepare({
originChainId: 42161,
originTokenAddress: "0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9", // USDT on Arbitrum
Expand Down Expand Up @@ -255,7 +255,7 @@ Send a payment between users using any combination of chains or tokens. thirdweb
await new Promise((resolve) => setTimeout(resolve, 3000)); // Wait 3 seconds
}
} while (swapStatus.status === "PENDING");

if (swapStatus.status === "FAILED") {
throw new Error("Swap transaction failed");
}
Expand Down
4 changes: 2 additions & 2 deletions apps/portal/src/app/payments/tokens/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { ExternalLink } from "lucide-react";

export const metadata = createMetadata({
image: {
title: "Payments",
icon: "pay",
title: "Get Token Prices",
icon: "payments",
},
title: "Get Token Prices",
description: "Use thirdweb Payments to get any token's current price and metadata.",
Expand Down
30 changes: 15 additions & 15 deletions apps/portal/src/app/payments/webhooks/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import {

export const metadata = createMetadata({
image: {
title: "Payments",
icon: "pay",
title: "Payments Webhooks",
icon: "payments",
},
title: "Payments Webhooks",
description: "Learn how to set up and handle webhooks for thirdweb Payments transactions.",
Expand All @@ -49,17 +49,17 @@ import { Bridge } from "thirdweb";
export async function POST(request: Request) {
const body = await request.text();
const headers = Object.fromEntries(request.headers.entries());

try {
const webhook = await Bridge.Webhook.parse(
body,
headers,
process.env.WEBHOOK_SECRET // Your webhook secret
);

// Process the webhook
console.log("Webhook received:", webhook);

return Response.json({ success: true });
} catch (error) {
console.error("Webhook verification failed:", error);
Expand Down Expand Up @@ -162,30 +162,30 @@ If you prefer to handle verification manually, you can verify webhooks using the

```typescript
async function verifyWebhook(
payload: string,
headers: Record<string, string>,
payload: string,
headers: Record<string, string>,
secret: string,
tolerance = 300 // 5 minutes
) {
// Get the signature and timestamp from headers
const receivedSignature = headers["x-payload-signature"] || headers["x-pay-signature"];
const receivedTimestamp = headers["x-timestamp"] || headers["x-pay-timestamp"];

if (!receivedSignature || !receivedTimestamp) {
throw new Error("Missing required webhook headers: signature or timestamp");
}

// Verify timestamp
const now = Math.floor(Date.now() / 1000);
const timestamp = parseInt(receivedTimestamp, 10);
const diff = Math.abs(now - timestamp);

if (diff > tolerance) {
throw new Error(
`Webhook timestamp is too old. Difference: ${diff}s, tolerance: ${tolerance}s`
);
}

// Generate signature using Web Crypto API
const encoder = new TextEncoder();
const key = await crypto.subtle.importKey(
Expand All @@ -195,23 +195,23 @@ async function verifyWebhook(
false,
["sign"]
);

const signature = await crypto.subtle.sign(
"HMAC",
key,
encoder.encode(`${receivedTimestamp}.${payload}`)
);

// Convert the signature to hex string
const computedSignature = Array.from(new Uint8Array(signature))
.map((b) => b.toString(16).padStart(2, "0"))
.join("");

// Compare signatures
if (computedSignature !== receivedSignature) {
throw new Error("Invalid webhook signature");
}

// Parse and return the payload
return JSON.parse(payload);
}
Expand Down
4 changes: 4 additions & 0 deletions apps/portal/src/app/vault/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ export const metadata = createMetadata({
description:
"Vault is an open-source non-custodial key management service, secured with TEE architecture (AWS Nitro Enclaves) and designed for blockchain applications.",
title: "Vault",
image: {
icon: "vault",
title: "thirdweb Vault",
},
});
4 changes: 4 additions & 0 deletions apps/portal/src/app/vault/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { ArrowLeftRightIcon, UserLockIcon, UsersIcon, WalletIcon } from "lucide-
export const metadata = createMetadata({
title: "thirdweb Vault",
description: "An open-source, secure key management service for storing, managing, and protecting cryptographic keys and secrets.",
image: {
icon: "vault",
title: "thirdweb Vault",
},
});

# Vault
Expand Down
3 changes: 2 additions & 1 deletion apps/portal/src/components/Document/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ type DynamicImageOptions = {
| "wallets"
| "auth"
| "contract"
| "payment"
| "payments"
| "vault"
| "infra"
| "rpc"
| "storage"
Expand Down
Loading