Skip to content

Conversation

@shineli1984
Copy link
Collaborator

@shineli1984 shineli1984 commented Nov 18, 2025

Summary

next version of Immutable Passport SDK.
Tasks (all tasks below must keep Passport SDK and Passport sample app working)
Stage 1

  • split Passport SDK to wallet and auth packages and make Passport SDK refer to them internally.
  • release an alpha version of the above
  • make Play use the above version
    Stage 2
  • remove the concept of environment from wallet and auth packages.
  • create new usage pattern for wallet and auth packages (see below)
  • Add default Auth implementation
    • Make UI nice for default auth login workflow
  • release 2.x wallet and auth packages
    Stage 3 - not this PR
  • make Play use the wallet and auth packages
    Stage 4 - not this PR
  • wallet linking
  • documentation for wallet and auth interface
  • Refactor the internal of wallet and auth packages to make the code more robust

new wallet and auth interface

For apps that only need wallet functionality:

// Old: Required OAuth client setup
import { Auth } from '@imtbl/auth';
import { connectWallet } from '@imtbl/wallet';

const auth = new Auth({ clientId: '...', redirectUri: '...' });
const provider = await connectWallet({ auth });

// New: Wallet-only mode (no OAuth client needed)
import { connectWallet } from '@imtbl/wallet';

const provider = await connectWallet();
// SDK automatically handles authentication with a shared client owned by Immutable

For apps that need user profile access:

// Still works: Provide your own auth client
import { Auth } from '@imtbl/auth';
import { connectWallet } from '@imtbl/wallet';

const auth = new Auth({ 
  clientId: 'your-client-id', 
  redirectUri: 'https://your-app.com/callback',
  scope: 'openid profile email transact', // Full access
});
const provider = await connectWallet({ auth });

Note

Introduce @imtbl/auth and @imtbl/wallet, refactor Passport to use them, add connectWallet with default auth and env‑less configs, and update sample app and tooling accordingly.

  • Core changes:
    • Split Passport into new packages: @imtbl/auth (OIDC auth, metrics, events, errors) and @imtbl/wallet (EIP-1193 provider, relayer/guardian, overlays, linking).
    • Refactor @imtbl/passport to consume and re‑export from Auth/Wallet; remove environment abstraction in favor of concrete URLs; introduce IMX-specific guardian client.
    • Add connectWallet API with default Immutable-hosted auth (no app client required), multi-chain presets, and EIP‑6963 announcement.
  • Wallet:
    • New WalletConfiguration, session activity via explicit API URL, fee token preference, SCW deploy-before-sign option.
    • Provider updates: request/typed data/sign flows, confirmation overlays, relayer client improvements, link external wallet + get linked addresses.
  • Auth:
    • Public Auth class (login, PKCE, tokens, events), typed errors/utilities, jest/tsup setup.
  • Sample App:
    • Updated to activeZkEvmProvider/account, default connect button, environment gating, event logging.
  • Ecosystem:
    • SDK aggregates new packages; dependency/version bumps, Jest type updates, ESLint configs; husky memory limit increased.

Written by Cursor Bugbot for commit 1798bc8. This will update automatically on new commits. Configure here.

@shineli1984 shineli1984 requested a review from a team as a code owner November 18, 2025 09:13
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@nx-cloud
Copy link

nx-cloud bot commented Nov 18, 2025

View your CI Pipeline Execution ↗ for commit 1798bc8

Command Status Duration Result
nx affected -t build,lint,test ✅ Succeeded 3m 7s View ↗
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 1m 27s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-05 00:43:20 UTC

@shineli1984 shineli1984 changed the title v3 :feat v3 Nov 24, 2025
@shineli1984 shineli1984 changed the title :feat v3 feat: v3 Nov 24, 2025
@shineli1984 shineli1984 changed the title feat: v3 feat(core): v3 Nov 24, 2025
@shineli1984 shineli1984 changed the title feat(core): v3 feat(passport): v3 Nov 24, 2025
Comment on lines -28 to -30
if (anonymousId) {
href += `&third_party_a_id=${anonymousId}`;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need this to track users across the embedded login prompt & the Auth0 login flow, don't we?

Copy link
Contributor

Choose a reason for hiding this comment

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

All tests removed. Are they going to be rewritten?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added tests

nattb8
nattb8 previously approved these changes Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants