Skip to content

Add Capacitor session example#2355

Merged
broody merged 2 commits intomainfrom
Larkooo/session-provider-example
Jan 28, 2026
Merged

Add Capacitor session example#2355
broody merged 2 commits intomainfrom
Larkooo/session-provider-example

Conversation

@Larkooo
Copy link
Contributor

@Larkooo Larkooo commented Jan 27, 2026

Adds a Capacitor-based session example and wires it into the workspace. Updates session handling to normalize redirect payloads and align executeFromOutside behavior across runtimes. Includes docs and Node example tweaks for consistency.

@vercel
Copy link

vercel bot commented Jan 27, 2026

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

Project Deployment Review Updated (UTC)
controller-example-next Ready Ready Preview Jan 27, 2026 11:53pm
keychain Ready Ready Preview Jan 27, 2026 11:53pm
keychain-storybook Ready Ready Preview Jan 27, 2026 11:53pm

Request Review

scarb 2.9.4
starknet-foundry 0.38.3
nodejs v20.11.1
nodejs 22.22.0
Copy link
Contributor

Choose a reason for hiding this comment

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

This version works fine too, I'll update our ci/vercel in another PR

@broody broody merged commit 4ea9eba into main Jan 28, 2026
15 checks passed
@broody broody deleted the Larkooo/session-provider-example branch January 28, 2026 00:40
@claude
Copy link
Contributor

claude bot commented Jan 28, 2026

Claude finished @Larkooo's task —— View job


Documentation Analysis and Updates Complete ✅

I've analyzed the controller repository PR changes and updated the documentation in the docs repository accordingly.

Tasks:

  • Examine docs-repo structure to understand current documentation
  • Analyze key changes from the PR (Capacitor example, session updates)
  • Review existing documentation that might need updates
  • Create/update documentation for new Capacitor integration
  • Update session-related documentation if needed
  • Commit and push changes if documentation updates are required

Summary of Changes Made

The PR introduced significant changes that required documentation updates:

1. Capacitor Documentation Updates (src/pages/controller/native/capacitor.md)

  • Fixed import path: Changed from @cartridge/connector to @cartridge/controller/session
  • Updated API usage: Replaced SessionConnector with SessionProvider
  • Added browser interception: Documented window.open override for native platforms
  • Enhanced deep link handling: Added ingestSessionFromRedirect() method usage
  • Updated URL schemes: Changed to use cartridge-session://session pattern
  • Simplified Android config: Removed complex App Links setup, focused on custom scheme
  • Added complete example reference: Links to the new /examples/capacitor directory

2. Node.js Example Updates (src/pages/controller/examples/node.md)

  • Updated network: Changed from mainnet to Sepolia testnet
  • Simplified policies: Removed approve method, focused on transfer only
  • Improved flow description: Added console output guidance
  • Enhanced error handling: Updated to match new error handling pattern

3. Sessions Documentation (src/pages/controller/sessions.md)

  • Added Manual Session Processing section: Documents the new ingestSessionFromRedirect() method
  • Explained use cases: Capacitor apps, native mobile apps, custom session handling
  • Provided code examples: Complete deep link handling workflow

Key Technical Changes Documented

  1. New SessionProvider API: The example now uses SessionProvider from @cartridge/controller/session instead of the connector
  2. Deep Link Processing: The new ingestSessionFromRedirect() method for manually processing session data from URL parameters
  3. Browser Interception: Required window.open override for Capacitor apps to use system browser
  4. Session Payload Handling: Normalized session payload processing with better error handling

Files Modified

  • docs-repo/src/pages/controller/native/capacitor.md - Complete rewrite to match new example
  • docs-repo/src/pages/controller/examples/node.md - Updated network and error handling
  • docs-repo/src/pages/controller/sessions.md - Added manual session processing documentation

Note: The documentation files have been updated locally but need to be manually committed to the docs repository due to git configuration restrictions. All changes are ready for commit.

kronosapiens added a commit to cartridge-gg/docs that referenced this pull request Feb 3, 2026
Updates documentation to reflect changes made in:
    Add Capacitor session example

    Related controller PR: cartridge-gg/controller#2355

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Daniel Kronovet <kronovet@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants