Skip to content

Document freighter-api disconnect method - #12

Closed
JakeUrban wants to merge 3 commits into
mainfrom
claude/freighter-api-disconnect-05975m
Closed

JakeUrban wants to merge 3 commits into
mainfrom
claude/freighter-api-disconnect-05975m

Conversation

@JakeUrban

@JakeUrban JakeUrban commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

What

This PR adds documentation for the new disconnect() method in @stellar/freighter-api. The method is added in stellar/freighter#3036.

Changes:

  • extension/connecting.md: Adds a "Disconnecting" section. The section tells:
    • What disconnect() does and what it returns.
    • That Freighter does not show a prompt to the user.
    • That the next requestAccess() or setAllowed() call shows a prompt again.
    • When the method returns an error: the user did not unlock Freighter after the browser started, or the installed Freighter version does not support disconnect().
    • A warning: disconnect() removes access only for the active account on the active network. The dApp keeps access to other accounts and networks that the user authorized before. The dApp gets that access again, without a prompt, when the user changes to one of them.
  • extension/playground/disconnect.md: Adds a playground page with a "Disconnect" button.
  • _sidebar.md and playgrounds-home.md: Add links to the new playground page.

Before merge

index.html loads @stellar/freighter-api@6.0.1. That version does not have disconnect(), so the playground button does not operate. Change index.html to load the freighter-api release that includes disconnect(). Do this after that release is on npm.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M6pbgqeBtJ7cL5biPuxBJ1


Generated by Claude Code

Add a disconnect section to the connecting guide and a playground
page. The playground needs index.html to load a freighter-api release
that includes disconnect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6pbgqeBtJ7cL5biPuxBJ1
@netlify

netlify Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for play-freighter-app ready!

Name Link
🔨 Latest commit 186562a
🔍 Latest deploy log https://app.netlify.com/projects/play-freighter-app/deploys/6ac913eaa200f2000835735b
😎 Deploy Preview https://deploy-preview-12--play-freighter-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

An idle lock keeps the active account, so disconnect works then. It
only fails before the first unlock after the browser starts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6pbgqeBtJ7cL5biPuxBJ1
@JakeUrban
JakeUrban marked this pull request as ready for review October 9, 2026 16:14
Copilot AI lite review requested due to automatic review settings October 9, 2026 16:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The playground must load a release that includes disconnect() before approval.

1 open finding
What changed in this PR

This PR documents the new disconnect() API and adds an interactive playground with navigation links.

Changes:

  • Documents behavior, errors, and account/network scope.
  • Adds a disconnect playground.
  • Adds navigation links.
  • Requires updating the playground’s API version before merging.
File Summary
playgrounds-home.md Adds the disconnect playground link.
extension/​playground/​disconnect.md Adds the playground; its API version currently predates disconnect().
extension/​connecting.md Documents disconnect(); authorization wording should be scoped to the active account and network.
_sidebar.md Adds sidebar navigation.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

el.className = 'playground-result';
el.textContent = 'Disconnecting...';
try {
var res = await window.freighterApi.disconnect();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Correct. This is a known merge blocker. The "Before merge" section of the PR description tells it.

The version change cannot occur now. No freighter-api release on npm includes disconnect() yet. stellar/freighter#3036 adds the method. After that release is on npm, this PR will change index.html to load it.

Until then, 186562a prevents the TypeError. If the loaded freighter-api does not include disconnect(), the page now shows this error: "the loaded version of @stellar/freighter-api does not include disconnect()". This thread stays open until the version change.


Generated by Claude Code

index.html loads a freighter-api version without disconnect() until
the next release. Show that cause instead of a TypeError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6pbgqeBtJ7cL5biPuxBJ1
Copilot AI lite review requested due to automatic review settings October 9, 2026 16:18
@JakeUrban

Copy link
Copy Markdown
Contributor Author

We need to release the disconnect method before we merge this docs update so the playground has the updated sdk.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Update the playground’s Freighter API dependency before merging.

1 open finding

🧠 Review effort: Lite

@CassioMG CassioMG closed this Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants