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>
| 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.
|
|
||
| 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
|
|
||
| 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
| **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?
| **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.
| | 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?
|
|
||
| ### `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.
There was a problem hiding this comment.
Good call - I'll add this
There was a problem hiding this comment.
May also be worth noting that eventually this function will be a no-op when we auto-detect transfers.
|
|
||
| `@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>
|
|
||
| ## 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) |
|
Hey @piyalbasu — I opened #2 targeting this branch with a migration of the mobile WalletConnect code samples. What it does:
Why: References: |
- Fix WalletConnect docs links to point to docs.walletconnect.network/app-sdk/overview (the .com URL routes to WalletConnect Pay) - Rename WalletConnect Cloud to WalletConnect Dashboard with new dashboard.walletconnect.com URL - Note that Stellar Wallets Kit's WC module only supports 2 of 4 Freighter Mobile signing methods Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Migrate mobile installation to @walletconnect/universal-provider
Replace @walletconnect/sign-client with @walletconnect/universal-provider
in installation instructions. Add Stellar Wallets Kit alternative note
and link to Reown docs.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Migrate mobile connecting to UniversalProvider
Replace SignClient connect/event/disconnect patterns with
UniversalProvider equivalents. Add public key extraction example.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Migrate mobile signing examples to UniversalProvider
Replace all client.request() calls with provider.request() pattern.
Update full connect-sign-submit example.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Remove isFreighterInAppBrowser branching from full example
The in-app browser detection is a Stellar Wallets Kit implementation
detail, not needed by dapp developers using UniversalProvider directly.
Simplified the full example and clarified the in-app vs external
browser UX difference in prose instead.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add AppKit modal for wallet selection and QR code display
- Add @reown/appkit to installation alongside universal-provider
- Initialize createAppKit with manualWCControl for standalone modal
- Use modal.open({ uri }) in display_uri handler instead of console.log
- Add links to Reown UniversalProvider and AppKit modal docs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Clarify that wallet selection triggers deep-linking
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Clarify that QR code and wallet list are in the same modal
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Pass universalProvider to createAppKit
Wire the provider to the modal via the universalProvider option,
matching the pattern from the Reown migration guide.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix review issues: modal API, imports, and cross-file clarity
Critical:
- Replace display_uri + modal.open({ uri }) with modal.open() before
provider.connect() — AppKit handles URI display automatically when
manualWCControl and universalProvider are set
Important:
- Add comment explaining mainnet placeholder in AppKit networks config
- Fix README chainId hint to reference provider.request() argument
- Add session null check after provider.connect()
Suggestions:
- Switch to named import { UniversalProvider } matching Reown docs
- Add cross-file reference notes to connecting.md and signing.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix: use namespaces instead of requiredNamespaces for UniversalProvider
UniversalProvider.ConnectParams does not accept requiredNamespaces —
the correct field is namespaces. Passing requiredNamespaces was silently
ignored, meaning the Stellar namespace would not be registered.
Also added a note explaining that UniversalProvider treats namespaces as
optional on the first connection (they become required on reconnections
via storage). dApps should verify session.namespaces.stellar.methods
after connecting.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JakeUrban
left a comment
There was a problem hiding this comment.
A few more comments but otherwise LGTM 👏
|
|
||
| Add Soroban tokens to a user's Freighter wallet programmatically. | ||
|
|
||
| ## Adding a Token |
There was a problem hiding this comment.
May also be worth noting that eventually this function will be a no-op when we auto-detect transfers.
- Clarify requestAccess() does full Allow List authorization, not just public key access - Remove internal password/caching details from signing docs (not actionable for dapps) - Add note that addToken() will become a no-op once auto-detect ships - Remove "Building the entryXdr" section from mobile signing (out of scope) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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]