Skip to content

# Sequence diagram for opening the Sequence Web SDK sign-in modal #285

@Dargon789

Description

@Dargon789

Reviewer's Guide

Adds a comprehensive top-level README for the Sequence Web SDK, documenting installation, configuration patterns, hooks, customization options, package layout, examples, and local development workflow.

Sequence diagram for opening the Sequence Web SDK sign-in modal

sequenceDiagram
  actor User
  participant MyReactComponent
  participant HooksModule
  participant OpenConnectModal as UseOpenConnectModalReturn
  participant WalletsState as UseWalletsReturn
  participant ConnectProvider as SequenceConnectProvider
  participant SignInModal

  User->>MyReactComponent: Click "Sign in" button
  MyReactComponent->>HooksModule: useOpenConnectModal()
  HooksModule-->>MyReactComponent: OpenConnectModal
  MyReactComponent->>HooksModule: useWallets()
  HooksModule-->>MyReactComponent: WalletsState (wallets[])

  MyReactComponent->>OpenConnectModal: setOpenConnectModal(true)
  OpenConnectModal->>ConnectProvider: update modal state (open)
  ConnectProvider->>SignInModal: render and display

  User->>SignInModal: Select wallet and authenticate
  SignInModal->>ConnectProvider: wallet connected
  ConnectProvider->>WalletsState: update wallets and linkedWallets
  WalletsState-->>MyReactComponent: wallets now non empty
  MyReactComponent-->>User: Hide "Sign in" button
Loading

Class diagram for Sequence Web SDK React integration and hooks

classDiagram
  class SequenceConnect {
  }

  class SequenceConnectProvider {
    +config ConnectConfig
  }

  class WagmiProvider {
    +config WagmiConfig
  }

  class SequenceWalletProvider {
  }

  class SequenceCheckoutProvider {
  }

  class CreateConfigOptions {
    +appName string
    +projectAccessKey string
    +chainIds number[]
    +defaultChainId number
    +disableAnalytics boolean
    +defaultTheme Theme
    +position ModalPosition
    +customCSS string
    +signIn SignInConfig
    +displayedAssets DisplayedAsset[]
    +ethAuth EthAuthSettings
    +wagmiConfig WagmiConfig
    +waasConfigKey string
    +enableConfirmationModal boolean
    +walletConnect WalletConnectConfig
    +guest boolean
    +google GoogleConfig
    +apple AppleConfig
    +X XConfig
    +email EmailConfig
  }

  class SignInConfig {
    +logoUrl string
    +projectName string
    +useMock boolean
  }

  class DisplayedAsset {
    +contractAddress string
    +chainId number
  }

  class WalletConnectConfig {
    +projectId string
  }

  class GoogleConfig {
    +clientId string
  }

  class AppleConfig {
    +clientId string
    +redirectURI string
  }

  class XConfig {
    +clientId string
    +redirectURI string
  }

  class EmailConfig {
    +legacyEmailAuth boolean
  }

  class ConnectConfig {
    +defaultTheme string
    +position string
    +signIn SignInConfig
    +displayedAssets DisplayedAsset[]
    +readOnlyNetworks number[]
    +projectAccessKey string
  }

  class ConnectedWallet {
    +id string
    +name string
    +address string
    +isActive boolean
    +isEmbedded boolean
  }

  class UseOpenConnectModalReturn {
    +setOpenConnectModal(isOpen boolean) void
  }

  class UseWalletsReturn {
    +wallets ConnectedWallet[]
    +linkedWallets ConnectedWallet[]
    +setActiveWallet(walletAddress string) Promise~void~
    +disconnectWallet(walletAddress string) Promise~void~
  }

  class UseThemeReturn {
    +theme string
    +setTheme(theme string) void
  }

  class HooksModule {
    +useOpenConnectModal() UseOpenConnectModalReturn
    +useWallets() UseWalletsReturn
    +useTheme() UseThemeReturn
  }

  class ConfigFactoryModule {
    +createConfig(walletType string, options CreateConfigOptions) ConnectConfig
    +getDefaultChains() Chain[]
    +getDefaultConnectors(walletType string, options CreateConfigOptions) Connector[]
  }

  SequenceConnect --> SequenceConnectProvider
  SequenceConnectProvider --> ConnectConfig
  SequenceConnectProvider ..> HooksModule

  WagmiProvider --> WagmiConfig
  ConfigFactoryModule --> WagmiConfig
  ConfigFactoryModule --> Chain
  ConfigFactoryModule --> Connector

  HooksModule --> UseOpenConnectModalReturn
  HooksModule --> UseWalletsReturn
  HooksModule --> UseThemeReturn

  CreateConfigOptions --> SignInConfig
  CreateConfigOptions --> DisplayedAsset
  CreateConfigOptions --> WalletConnectConfig
  CreateConfigOptions --> GoogleConfig
  CreateConfigOptions --> AppleConfig
  CreateConfigOptions --> XConfig
  CreateConfigOptions --> EmailConfig

  ConnectConfig --> SignInConfig
  ConnectConfig --> DisplayedAsset
Loading

Flow diagram for React provider setup in Sequence Web SDK

flowchart TD
  A[App_root] --> B[WagmiProvider<br>config: wagmiConfig]
  B --> C[QueryClientProvider<br>client: queryClient]
  C --> D[SequenceConnectProvider<br>config: connectConfig]
  D --> E[SequenceWalletProvider]
  E --> F[SequenceCheckoutProvider]
  F --> G[Content_component]

  subgraph Config_creation
    H[projectAccessKey,<br>chainIds,<br>appName] --> I[createConfig or getDefaultConnectors]
    I --> J[wagmiConfig]
    H --> K[connectConfig]
  end

  J --> B
  K --> D
Loading

File-Level Changes

Change Details Files
Introduce top-level README documenting installation, setup, and configuration of Sequence Web SDK.
  • Document npm installation command, required peer dependencies, and core package role of @0xsequence/connect
  • Describe createConfig API, its options (wallet types, social auth providers, theming, analytics, WalletConnect, guest mode, etc.), and provide a minimal provider-wrapped React App example
  • Explain X/Twitter OAuth callback behavior and include a sample callback component implementation
README.md
Document advanced React integration with wagmi, Sequence providers, and supporting libraries.
  • Show how to compose WagmiProvider, QueryClientProvider, SequenceConnectProvider, SequenceWalletProvider, and SequenceCheckoutProvider in the correct nesting order
  • Demonstrate use of getDefaultChains and getDefaultConnectors to configure universal or WaaS connectors, transports, and wagmiConfig
  • Provide example connectConfig usage highlighting projectAccessKey and relationship to provider config
README.md
Add hook usage examples and customization options for the connect modal and wallet handling.
  • Describe useOpenConnectModal hook for programmatically opening the sign-in modal with a basic button example
  • Describe useWallets hook, including ConnectedWallet shape, multiple wallet management, active wallet switching, and disconnection
  • Describe useTheme hook for reading and changing theme and show configuration-based customization of SequenceConnectProvider (theme, modal position, sign-in branding, displayedAssets, readOnlyNetworks)
README.md
Document package structure, example apps, and local development workflow for the web SDK monorepo.
  • Add a Packages table linking to connect, wallet-widget, and checkout packages with short descriptions and per-package README links
  • Add an Examples table linking to React and Next example apps with brief descriptions and docs links
  • Describe local development steps including using workspace:* dependencies, building or running in dev/watch mode, and commands to run example apps
  • Add license section specifying Apache-2.0 and Horizon Blockchain Games copyright notice
README.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Originally posted by @sourcery-ai[bot] in #284 (comment)

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdependenciesPull requests that update a dependency filedocumentationImprovements or additions to documentationduplicateThis issue or pull request already existsenhancementNew feature or requestgood first issueGood for newcomershelp wantedExtra attention is neededinvalidThis doesn't seem rightjavascriptPull requests that update javascript codequestionFurther information is requested

Projects

Status

Backlog

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions