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

Splits Passport into new @imtbl/auth and @imtbl/wallet packages, introduces connectWallet API and refactors Passport/SDK and sample app to use them while removing environment-centric configs.

  • Architecture:
    • Introduces new packages @imtbl/auth and @imtbl/wallet; Passport now composes these internally.
    • Removes legacy auth manager and environment-centric configuration; adds chain-based configs and presets.
  • Wallet:
    • Adds connectWallet with optional default Auth; supports multi-chain ChainConfig, EIP-6963 announcement, session activity updates.
    • Implements GuardianClient, RelayerClient refinements, overlay UI components, and wallet linking helpers (linkExternalWallet, getLinkedAddresses).
  • Auth:
    • Provides standalone Auth (OIDC, metrics wrappers, configuration/typing, error handling); exports events/utilities.
  • Passport:
    • Refactors to consume @imtbl/auth/@imtbl/wallet, simplifies APIs, re-exports types/errors; IMX workflows moved to ImxGuardianClient.
  • SDK/Exports:
    • SDK now exports @imtbl/auth and @imtbl/wallet; updates exports and re-exports across packages.
  • Sample App:
    • Updates to use new wallet provider shape (activeZkEvmProvider, connect with defaults), UI tweaks, and event wiring.
  • Tooling/Configs:
    • Adds ESLint/Jest/TS configs for new packages; updates deps (uuid, @types/jest, tsup), bumps Husky NODE_OPTIONS.

Written by Cursor Bugbot for commit 583b130. 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 583b130

Command Status Duration Result
nx run-many -p @imtbl/sdk,@imtbl/checkout-widge... ✅ Succeeded 4s View ↗

☁️ Nx Cloud last updated this comment at 2025-12-03 06:18:31 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

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