Conversation
Migrate docs from freighter-integration-docs, removing unused GitBook assets. Includes developer guide, mobile integration, and API reference. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR overhauls the Freighter developer documentation by introducing a structured table of contents and adding/rewriting integration guides for both the browser extension (@stellar/freighter-api) and Freighter Mobile via WalletConnect v2.
Changes:
- Added GitBook navigation structure (
.gitbook.yaml,SUMMARY.md) and a Docsifyindex.htmlfor local browsing. - Rewrote the root
README.mdto provide clearer integration pathways and quick links. - Added new extension and mobile guide pages covering installation, connecting, signing, and related features.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
.gitbook.yaml |
Defines GitBook structure (readme + summary). |
SUMMARY.md |
Adds a table of contents organizing Extension, Mobile, and Integrations docs. |
README.md |
New landing page with integration selection, quick links, and resources. |
index.html |
Adds Docsify-based local documentation viewer. |
developer-guide/README.md |
Extension developer guide overview and API entry points. |
developer-guide/installation.md |
Extension install/setup instructions (npm/yarn + CDN). |
developer-guide/connecting.md |
Extension connection/authorization flows (isConnected, isAllowed, setAllowed, requestAccess). |
developer-guide/reading-data.md |
Extension read methods for address/network details. |
developer-guide/signing.md |
Extension signing docs + end-to-end example. |
developer-guide/token-management.md |
Adds Soroban token add flow (addToken). |
developer-guide/watching-changes.md |
Documents WatchWalletChanges polling watcher. |
mobile/README.md |
Mobile WalletConnect overview, chains, API list, and error handling. |
mobile/installation.md |
WalletConnect client installation and initialization. |
mobile/connecting.md |
WalletConnect session creation, events, and disconnect flow. |
mobile/signing.md |
WalletConnect signing methods and auth-entry signing example. |
integrations/README.md |
Lists documented third-party integrations (Soroswap, HW wallets). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
Code reviewFound 4 issues:
freighter-developer-docs/developer-guide/signing.md Lines 67 to 69 in 6af05eb
freighter-developer-docs/developer-guide/installation.md Lines 50 to 52 in 6af05eb
freighter-developer-docs/developer-guide/signing.md Lines 120 to 122 in 6af05eb
freighter-developer-docs/developer-guide/connecting.md Lines 58 to 62 in 6af05eb 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Code reviewFound 1 issue:
freighter-developer-docs/developer-guide/installation.md Lines 50 to 58 in 6af05eb 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…r compat issues
- Fix mobile/ link to mobile/README.md for GitBook/docsify compatibility
- Replace undocumented signBlob with signMessage in import example
- Standardize on @stellar/stellar-sdk (not js-stellar-sdk or stellar-sdk)
- Fix broken soroban-development.md link to point to Stellar developer docs
- Fix CDN paths from dist/ to build/ to resolve 404s
- Correct setAllowed() return type description to { isAllowed: true }
- Clarify chainId is a top-level WalletConnect request field, not inside params
- Replace Buffer.from() with TextEncoder/atob for browser compatibility
- Use consistent client.request() variable name in auth entry example
- Pin docsify (4.13.1) and prismjs (1.29.0) CDN versions
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The actual @stellar/freighter-api returns error as a FreighterApiError
object with { code, message, ext? }, not a plain string. Updated all
return type signatures and code examples to use error.message.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Blockaid site scan happens at connection time, not at auth-entry signing time - Add missing "non-string" condition to signAuthEntry error table Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Rewrote README.md with What You Can Build, How It Works, and Why Freighter sections to walk developers through the integration experience without code samples - Added Stellar Wallets Kit (stellarwalletskit.dev) to the Introduction and Integrations page for multi-wallet support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code reviewFound 1 issue:
freighter-developer-docs/developer-guide/signing.md Lines 119 to 150 in a96a02a 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Code reviewFound 2 issues:
freighter-developer-docs/developer-guide/reading-data.md Lines 20 to 27 in a96a02a
freighter-developer-docs/index.html Lines 18 to 22 in a96a02a 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
- reading-data.md: console.error(error) -> console.error(error.message) to match FreighterApiError object type (missed in earlier update) - index.html: docsify path dist/ -> lib/ to fix 404 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
README.md
Outdated
| Freighter wallet developer documentation | ||
| # Welcome to Freighter | ||
|
|
||
| Freighter is a non-custodial wallet for the Stellar network, available as a browser extension and a mobile app. This guide will walk you through integrating Freighter into your dapp so your users can connect their wallets, sign transactions, and interact with Soroban smart contracts — all without you ever touching a private key. |
There was a problem hiding this comment.
There is a strong emphasis throughout these docs on user control and the dapp's limited liability
- "without you ever touching a private key"
- "the user reviews everything [...] and stays in full control"
- "You never handle private keys, seed phrases, or encryption."
I'm not sure this is a major concern for our audience worth addressing repeatedly. It may make sense to briefly describe what a self-custody/non-custodial wallet is, but once we do that I think repeated references are redundant.
README.md
Outdated
|
|
||
| For **desktop browsers**, you integrate with the Freighter extension through a lightweight JavaScript library. It injects itself into the page, and your dapp calls methods like "is the wallet connected?", "what's the user's address?", and "please sign this transaction." Every sensitive action goes through the extension's UI where the user has full visibility and control. | ||
|
|
||
| For **mobile**, the integration works over WalletConnect v2. Your dapp generates a connection URI, the user scans a QR code with Freighter Mobile, and a secure relay session is established. From that point on, signing requests flow through the same pattern — your dapp proposes, the user reviews and approves in the wallet. |
There was a problem hiding this comment.
QR code scanning makes sense when you're connecting Freighter mobile to a website running in your desktop browser, but I think we should focus more on the in-app browser scenario. In that scenario a walletconnect-managed panel is displayed for the user to select their wallet.
ScreenRecording_04-10-2026.10-11-56_1.MP4
README.md
Outdated
|
|
||
| Both paths produce the same output: signed transactions you can submit to the Stellar network. So your backend and submission logic stay the same regardless of whether your user connected from a laptop or a phone. | ||
|
|
||
| If you want to support multiple Stellar wallets — not just Freighter — take a look at [Stellar Wallets Kit](https://stellarwalletskit.dev/). It provides a unified interface across Stellar desktop wallets so your users can connect with whichever browser extension they prefer. Note that it currently supports desktop wallets only, not mobile. |
There was a problem hiding this comment.
stellar-wallets-kit supports walletconnect, which works on mobile?
There was a problem hiding this comment.
oh didn't realize they added this - I'll update
There was a problem hiding this comment.
I've just realized SWK doesn't give support for signMessag and signAuthEntry for WC modules so I created this ticket to handle that with Enrique: stellar/freighter-mobile#815
for the moment dApps would need to handle WC implementation directly to explore all methods Freighter Mobile currently supports
|
|
||
| If you want to support multiple Stellar wallets — not just Freighter — take a look at [Stellar Wallets Kit](https://stellarwalletskit.dev/). It provides a unified interface across Stellar desktop wallets so your users can connect with whichever browser extension they prefer. Note that it currently supports desktop wallets only, not mobile. | ||
|
|
||
| ## Why Freighter |
There was a problem hiding this comment.
It feels like we're providing answers to this question for an audience that is considering building their own wallet as an alternative. But I think the real question is freighter vs. lobstr vs. xbull vs. stellar-wallets-kit.
Some reasons I can think of in that light:
- developed and maintained by the SDF
- most advanced Stellar wallet. (ex. custom tokens, auth entry and message signing, auth entry inspection, etc.)
There was a problem hiding this comment.
Alternatively, we could omit this section if we want to avoid comparisons. The audience is already reading this documentation, after all.
There was a problem hiding this comment.
I think I prefer the first suggestion here. Engineers often read integration guides (especially the introduction) of multiple SDK's to determine which option would scale the best for their specific use-case. IMO, It makes sense to highlight why they would want to use Freighter over another wallet
README.md
Outdated
| **Ideal for:** | ||
|
|
||
| - React, Vue, or Angular web apps | ||
| - Server-rendered apps (Next.js, Nuxt) | ||
| - Static sites via CDN |
There was a problem hiding this comment.
Maybe remove since its the only option for desktop browsers?
README.md
Outdated
| **Ideal for:** | ||
|
|
||
| - Mobile-first dapps | ||
| - Cross-platform apps that support both desktop and mobile wallets | ||
| - Dapps using WalletConnect for multi-wallet support |
There was a problem hiding this comment.
Same there -- only option for mobile.
README.md
Outdated
| | I want to... | Extension | Mobile | | ||
| | ------------------------------------- | -------------------------------------------------- | ---------------------------------------------------- | | ||
| | Install / set up | [Installation](developer-guide/installation.md) | [Installation](mobile/installation.md) | | ||
| | Connect to Freighter | [Connecting](developer-guide/connecting.md) | [Connecting](mobile/connecting.md) | | ||
| | Sign a transaction | [Signing](developer-guide/signing.md) | [Signing](mobile/signing.md) | | ||
| | Add a token | [Token Management](developer-guide/token-management.md) | — | |
There was a problem hiding this comment.
nit: can we rename the developer-guide directory to extension to match mobile?
extension/connecting.md
Outdated
|
|
||
| ### `requestAccess()` | ||
|
|
||
| Prompt the user for permission to access their public key. This is the **recommended** way to initiate a connection with Freighter — it handles both authorization and key retrieval in one call. |
There was a problem hiding this comment.
To this point about being the recommended approach, do we want to discourage usage of setAllowed/isAllowed? I think we even had discussions about deprecating these functions.
There was a problem hiding this comment.
Generally in integration guides, you want to optimize for clarity rather than being comprehensive. So even if there are multiple ways to do something, you want to guide users in the direction you want them to take.
There was a problem hiding this comment.
Actually, on second thought, we shouldn't add a recommendation here. setAllowed also handles authorization. The key difference is one returns the public key and the other just returns a boolean. I believe the Aha folks requested one of these.
One isn't necessarily better than the other, it just depends on your use-case.
Co-authored-by: Jake Urban <10968980+JakeUrban@users.noreply.github.com>
Co-authored-by: Jake Urban <10968980+JakeUrban@users.noreply.github.com>
|
|
||
| Add Soroban tokens to a user's Freighter wallet programmatically. | ||
|
|
||
| ## Adding a Token |
There was a problem hiding this comment.
should we consider explaining why you would do this? I think it's a surprise generally that you need to do this at all.
extension/README.md
Outdated
|
|
||
| `@stellar/freighter-api` adheres to the [SEP-43](https://github.com/stellar/stellar-protocol/blob/master/ecosystem/sep-0043.md) standard for wallet interfaces on Stellar, and also offers additional methods beyond the spec such as `getNetworkDetails`, `addToken`, and `WatchWalletChanges`. | ||
|
|
||
| ## Importing |
There was a problem hiding this comment.
This section references the freighter-api but we don't explain what it is until the next section called "Connecting". Should we consider a rearrangement of this info or wether it belongs in the overview?
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Define non-custodial once in the opening line and remove repeated references to private key handling and user control throughout the page. Addresses PR review feedback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The primary mobile use case is the in-app browser where WalletConnect shows a wallet selection panel, not QR scanning. QR is now mentioned as a secondary desktop-to-mobile option. Addresses PR review feedback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…nect Removes incorrect "desktop only" note. Addresses PR review feedback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Focus on what sets Freighter apart from Lobstr, xBull, etc: SDF-maintained, most advanced feature set (custom tokens, auth entry inspection, message signing, Blockaid scanning), desktop + mobile. Addresses PR review feedback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Extension is the only option for desktop, WalletConnect is the only option for mobile — there's no real choice. Simplified to direct links per platform. Addresses PR review feedback. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace "Soroban token" and "custom token" with "contract token" to match developers.stellar.org nomenclature. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Addresses PR feedback that the overview references freighter-api imports before the reader has been through installation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Removed the "Supporting Both Extension and Mobile" section from the mobile overview (contained inaccurate window.freighterApi reference). Added a concise "Both" option to the Get Started section instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. "dApp" -> "Dapp" in mobile/installation.md (consistent with rest) 2. Network table: "Mainnet" -> "Mainnet (PUBLIC)" to map to enum value 3. "Pubnet's passphrase" -> "Mainnet passphrase" in token-management 4. Mobile connecting title: "Connecting" -> "Connecting to Freighter Mobile" 5. Added note about different response field names between extension and mobile (signedTxXdr vs signedXDR, signedMessage vs signature) 6. Clarified SEP-43 reference in mobile API table 7. Added error tables to extension signing methods (matching mobile) 8. Aligned parameter/example headings to bold text (matching mobile) 9. SUMMARY.md: "Extension" -> "Extension (freighter-api)" for symmetry 10. Added full connect-sign-submit example to mobile signing Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code reviewFound 2 issues:
freighter-developer-docs/extension/connecting.md Lines 22 to 26 in 53048a9
freighter-developer-docs/mobile/signing.md Lines 278 to 286 in 53048a9 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
- isConnected() hint: clarify it checks for extension installation, not mobile detection. Point to window.stellar?.platform for that. - Mobile signing full example: add all 4 methods to requiredNamespaces (was missing stellar_signMessage and stellar_signAuthEntry). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| @@ -0,0 +1,56 @@ | |||
| # Mobile Integration | |||
|
|
|||
| Connect your dapp to Freighter Mobile using the [WalletConnect v2](https://docs.walletconnect.com/) protocol. All methods follow the standard JSON-RPC 2.0 request/response format over a WalletConnect session. | |||
There was a problem hiding this comment.
we should use this link instead: https://docs.walletconnect.network/app-sdk/overview
this other address (https://docs.walletconnect.com/) links to WalletConnect Pay which is a different thing
| @@ -0,0 +1,56 @@ | |||
| # Mobile Integration | |||
|
|
|||
| Connect your dapp to Freighter Mobile using the [WalletConnect v2](https://docs.walletconnect.com/) protocol. All methods follow the standard JSON-RPC 2.0 request/response format over a WalletConnect session. | |||
There was a problem hiding this comment.
| Connect your dapp to Freighter Mobile using the [WalletConnect v2](https://docs.walletconnect.com/) protocol. All methods follow the standard JSON-RPC 2.0 request/response format over a WalletConnect session. | |
| Connect your dapp to Freighter Mobile using the [WalletConnect v2](https://docs.walletconnect.network/app-sdk/overview) protocol. All methods follow the standard JSON-RPC 2.0 request/response format over a WalletConnect session. |
|
|
||
| ## See also | ||
|
|
||
| - [WalletConnect v2 Docs](https://docs.walletconnect.com/) |
There was a problem hiding this comment.
| - [WalletConnect v2 Docs](https://docs.walletconnect.com/) | |
| - [WalletConnect v2 Docs](https://docs.walletconnect.network/app-sdk/overview) |
|
|
||
| ## Prerequisites | ||
|
|
||
| 1. Sign up at [WalletConnect Cloud](https://cloud.walletconnect.com/) and create a project to get your **Project ID**. |
There was a problem hiding this comment.
| 1. Sign up at [WalletConnect Cloud](https://cloud.walletconnect.com/) and create a project to get your **Project ID**. | |
| 1. Sign up at [WalletConnect Dashboard](https://dashboard.walletconnect.com/) and create a project to get your **Project ID**. |
|
Hey @piyalbasu — I opened #2 targeting this branch with a migration of the mobile WalletConnect code samples. What it does:
Why: References: |
|
|
||
| For **desktop browsers**, you integrate with the Freighter extension through a lightweight JavaScript library. It injects itself into the page, and your dapp calls methods like "is the wallet connected?", "what's the user's address?", and "please sign this transaction." | ||
|
|
||
| For **mobile**, the integration works over WalletConnect v2. When a user opens your dapp in a mobile browser, WalletConnect presents a panel where they select Freighter as their wallet and approve the connection. On desktop, the same flow can display a QR code for the user to scan. Either way, a secure relay session is established and signing requests flow through the same pattern — your dapp proposes, the user reviews and approves in the wallet. |
There was a problem hiding this comment.
| For **mobile**, the integration works over WalletConnect v2. When a user opens your dapp in a mobile browser, WalletConnect presents a panel where they select Freighter as their wallet and approve the connection. On desktop, the same flow can display a QR code for the user to scan. Either way, a secure relay session is established and signing requests flow through the same pattern — your dapp proposes, the user reviews and approves in the wallet. | |
| For **mobile**, the integration works over WalletConnect v2. When a user opens your dapp in a mobile browser, WalletConnect presents a modal where they select Freighter as their wallet and approve the connection. On desktop, the same flow can display a QR code for the user to scan. Either way, a secure relay session is established and signing requests flow through the same pattern — your dapp proposes, the user reviews and approves in the wallet. |
This pull request introduces a comprehensive overhaul of the Freighter wallet developer documentation. The updates include a new documentation structure, a rewritten and expanded developer guide, and improved navigation for both browser extension and mobile integration. The documentation now provides clear, example-driven guides for all major Freighter API features, as well as a summary table and integration resources.
Documentation Restructure and Navigation:
.gitbook.yamlandSUMMARY.mdto define the documentation structure and table of contents, organizing content by integration type and feature. [1] [2]index.htmlto support Docsify-based local documentation browsing, enabling easier preview and navigation.Content Overhaul and Expansion:
README.mdto provide a welcoming introduction, integration options, quick links, and resource references, making it easier for developers to get started and find relevant guides.integrations/README.mdpage to document third-party integrations such as Soroswap and hardware wallets, encouraging ecosystem adoption.Developer Guide Enhancements:
developer-guide/:WatchWalletChangesAPI.developer-guide/README.md) summarizing the API and linking to all feature pages.These changes make the documentation more accessible, up-to-date, and actionable for both new and experienced developers.
References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]