Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Sep 18, 2025


PR-Codex overview

This PR introduces new documentation and guidance for integrating the thirdweb SDK with various libraries, enhancing the user experience by providing detailed usage instructions and examples for adapters, particularly with wagmi, privy, and ethers.

Detailed summary

  • Added a new section in sidebar.tsx for "Usage with other libraries".
  • Expanded documentation in page.mdx on using thirdweb with:
    • wagmi, including setup and wallet connection examples.
    • privy, detailing wallet integration.
    • EIP1193, viem, and ethers.js v5 & v6, with conversion examples.
  • Included links to demo repositories for practical implementation.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features

    • Added a “Usage with other libraries” guide link under Wallets > Guides for quick navigation.
  • Documentation

    • Introduced a comprehensive guide on interoperating thirdweb with popular wallet/client ecosystems, including EIP-1193, wagmi, Privy, viem, and ethers.js v5/v6.
    • Provides installation steps, configuration examples, and code snippets for converting wallets, providers, and accounts between ecosystems.
    • Includes flows for connecting via wagmi, handling account changes, and converting to/from viem and ethers signers.
    • Added references to adapter docs and demo repositories for practical integration examples.

@vercel
Copy link

vercel bot commented Sep 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs-v2 Ready Ready Preview Comment Sep 19, 2025 0:11am
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
nebula Skipped Skipped Sep 19, 2025 0:11am
thirdweb_playground Skipped Skipped Sep 19, 2025 0:11am
thirdweb-www Skipped Skipped Sep 19, 2025 0:11am
wallet-ui Skipped Skipped Sep 19, 2025 0:11am

@vercel vercel bot temporarily deployed to Preview – nebula September 18, 2025 23:42 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui September 18, 2025 23:42 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground September 18, 2025 23:42 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www September 18, 2025 23:42 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Sep 18, 2025

⚠️ No Changeset found

Latest commit: d36691a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 18, 2025

Walkthrough

A new documentation page was added for wallets/adapters, detailing interoperability between Thirdweb and external wallet libraries. The wallets sidebar was updated to include a link to this page under Guides. No runtime logic or public API signatures were changed.

Changes

Cohort / File(s) Summary
Documentation: Wallet Adapters Guide
apps/portal/src/app/wallets/adapters/page.mdx
Added a comprehensive guide covering usage with wagmi, Privy, EIP-1193, viem, ethers v6, and ethers v5, including installation steps, conversion utilities, and code examples.
Portal Sidebar Navigation
apps/portal/src/app/wallets/sidebar.tsx
Inserted a new Guides item "Usage with other libraries" linking to /wallets/adapters using walletSlug, positioned after "Export Private Keys".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description contains the repository template block plus a helpful PR‑Codex overview that summarizes the added documentation and sidebar change, but it does not populate the template's required fields such as "Notes for the reviewer" and "How to test" and does not include an explicit issue/Linear tag or concrete test steps. Because those template sections are left empty, reviewers lack clear guidance for verification and any repo-specific merge considerations (e.g., Graphite merge-queue instructions) are only present in comments rather than the structured template. Therefore the description does not fully satisfy the repository's PR description requirements. Please populate the template fields: add a one-line title if needed and paste the issue/Linear tag, fill "Notes for the reviewer" with important merge/CI guidance (including Graphite merge-queue notes if relevant), and add a "How to test" section with concrete verification steps such as commands to build or preview the portal docs, steps to run the demo locally, and the expected outcomes so reviewers can validate the changes easily.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "[Portal] Add documentation for third-party library adapters" accurately captures the primary change — adding Portal documentation for third‑party wallet adapters — and is concise and specific without noisy details. It clearly reflects the main intent of the changeset and will be understandable to teammates scanning history. The phrasing follows the repository's prefix convention and does not mislead about the contents of the PR.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch _Portal_Add_documentation_for_third-party_library_adapters

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the Portal Involves changes to the Portal (docs) codebase. label Sep 18, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@joaquim-verges joaquim-verges marked this pull request as ready for review September 18, 2025 23:43
@joaquim-verges joaquim-verges requested review from a team as code owners September 18, 2025 23:43
@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.35%. Comparing base (4482692) to head (d36691a).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8074   +/-   ##
=======================================
  Coverage   56.35%   56.35%           
=======================================
  Files         906      906           
  Lines       59168    59168           
  Branches     4172     4172           
=======================================
  Hits        33342    33342           
  Misses      25720    25720           
  Partials      106      106           
Flag Coverage Δ
packages 56.35% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 63.96 KB (0%) 1.3 s (0%) 169 ms (+186.62% 🔺) 1.5 s
thirdweb (cjs) 361.44 KB (0%) 7.3 s (0%) 557 ms (+13.98% 🔺) 7.8 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 72 ms (+3105.99% 🔺) 186 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 30 ms (+1977.78% 🔺) 41 ms
thirdweb/react (minimal + tree-shaking) 19.14 KB (0%) 383 ms (0%) 73 ms (+2532.78% 🔺) 456 ms

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (7)
apps/portal/src/app/wallets/adapters/page.mdx (7)

89-94: Fix incomplete import statement.

The code shows an incomplete import on line 96 with a double newline, which may cause issues.

-import { useDisconnect, useSwitchChain, useWalletClient } from 'wagmi'
-import { client } from './client'
-

+import { useDisconnect, useSwitchChain, useWalletClient } from 'wagmi'
+import { client } from './client'

97-97: Add missing import for useAccount hook.

The useAccount hook is used but not imported from wagmi.

-import { useDisconnect, useSwitchChain, useWalletClient } from 'wagmi'
+import { useAccount, useDisconnect, useSwitchChain, useWalletClient } from 'wagmi'

104-107: Add missing chainId variable declaration.

The chainId variable is referenced but not declared or imported.

+        const chainId = account.chainId; // or get from useChainId() hook
         const provider = await account?.connector?.getProvider({
           chainId,
         });

134-134: Remove unused ethers5Adapter import.

The ethers5Adapter import is not used in the Privy example.

-import { ethers5Adapter } from 'thirdweb/adapters/ethers5';

207-214: Add missing import and improve code clarity.

The createWalletClient function is referenced but not imported. Also, the ellipsis should be replaced with proper parameters or a comment.

+import { createWalletClient } from 'viem';
+
 // convert a viem wallet client to a thirdweb wallet
-const walletClient = createWalletClient(...);
+const walletClient = createWalletClient({
+  // your viem wallet client configuration
+});

237-241: Add proper type import and improve code clarity.

The ethers.Signer type should be imported from ethers v6, and the ellipsis should be more descriptive.

+import { ethers } from 'ethers'; // v6
+
 // convert a ethers signer
-const signer: ethers.Signer = ...;
+const signer: ethers.Signer = /* your ethers v6 signer */;

284-288: Add proper type import and improve code clarity.

Similar to the ethers v6 example, the ethers v5 example should have proper imports and clearer placeholder code.

+import { ethers } from 'ethers'; // v5
+
 // convert an ethers signer to a thirdweb account
-const signer: ethers.Signer = ...;
+const signer: ethers.Signer = /* your ethers v5 signer */;
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f3b3b89 and d36691a.

📒 Files selected for processing (2)
  • apps/portal/src/app/wallets/adapters/page.mdx (1 hunks)
  • apps/portal/src/app/wallets/sidebar.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial, Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose

**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size

Files:

  • apps/portal/src/app/wallets/sidebar.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)

Files:

  • apps/portal/src/app/wallets/sidebar.tsx
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : Unified `Wallet` and `Account` interfaces in wallet architecture
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules
📚 Learning: 2025-07-18T19:19:55.613Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-18T19:19:55.613Z
Learning: Applies to packages/thirdweb/src/wallets/** : EIP-1193, EIP-5792, EIP-7702 standard support in wallet modules

Applied to files:

  • apps/portal/src/app/wallets/adapters/page.mdx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Size
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (7)
apps/portal/src/app/wallets/sidebar.tsx (1)

68-71: LGTM! Clean addition to navigation structure.

The new navigation item is appropriately placed in the Guides section and follows the consistent pattern of using ${walletSlug} for path construction.

apps/portal/src/app/wallets/adapters/page.mdx (6)

121-121: Secondary demo repo verified — no action required.

Referenced wagmi + thirdweb demo repository is reachable (HTTP 200).


18-26: Demo repo reachable (HTTP 200) — verify the repository contents match the referenced "wagmi + thirdweb" demo and update the href/description if not.


30-32: Package name verified — @thirdweb-dev/wagmi-adapter is used consistently in the repo.
Found in: packages/wagmi-adapter/package.json, packages/wagmi-adapter/CHANGELOG.md, README.md, and docs under apps/portal (e.g. apps/portal/src/app/wallets/adapters/page.mdx); no mismatches detected.


34-34: Verified wagmi minimum version requirement

npm shows wagmi v2.14.1 was published and the latest is v2.17.0 — the line "Make sure you're running wagmi 2.14.1 or above." is accurate; no change required.


1-1: All imported components are present and exported from @doc. Confirmed apps/portal/tsconfig.json maps @doc → ./src/components/Document and apps/portal/src/components/Document/index.ts exports Stack, InstallTabs, Callout, Step, Steps, and GithubTemplateCard.


54-57: EIP-7702 usage is correctmode: "EIP7702", sponsorGas: true properly enables the EIP-7702 gas-sponsorship feature for account abstraction.

@joaquim-verges joaquim-verges merged commit 59616d0 into main Sep 19, 2025
27 checks passed
@joaquim-verges joaquim-verges deleted the _Portal_Add_documentation_for_third-party_library_adapters branch September 19, 2025 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Portal Involves changes to the Portal (docs) codebase.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants