Migration Guide
For a while now, the Stacks community has been working on a new standard for wallet-to-dapp communication. Stacks Connect and related projects now use standards like WBIPs and SIP-030 to allow wallets to communicate with dapps in a more simplified and flexible way.
Deprecations
The following classes, methods, and types are deprecated in favor of the new request RPC methods:
show...andopen...methodsauthenticatemethodUserSessionclass and related functionalityAppConfigclassSessionOptionsinterfaceSessionDatainterfaceUserDatainterfaceSessionDataStoreclassInstanceDataStoreclassLocalStorageStoreclass
Migration steps
Replace legacy methods with request
requestSwitch from showXyz, openXyz, and doXyz helpers to the generic request(method, params) API. The request function is async, so replace onFinish/onCancel callbacks with await or .then().catch() chains.
Examples:
showConnect(),authenticate()→connect()useConnect().doContractCall({})→request('stx_callContract', {})openContractDeploy()→request('stx_deployContract', {})
Remove legacy code
Delete references to deprecated helpers (
AppConfig,UserSession, etc.)Remove the
@stacks/connect-reactpackageManually reload components if you rely on local storage updates
Hooks are no longer required for Stacks Connect
A new
@stacks/reactpackage is in development to simplify state tracking (transaction status, network changes, and more)
Address Access
Previously, the UserSession class was used to access the user's addresses and data, which abstracted away the underlying implementation details. Now, the request method is used to directly interact with the wallet, giving developers more explicit control and clarity over what's happening under the hood. This manual approach makes the wallet interaction more transparent and customizable. Developers can manually manage the currently connected user's address in e.g. local storage, jotai, etc. or use the connect()/request() method to cache the address in local storage.
Security note
8.x.x wallets return only the current network's address (previous versions returned both mainnet and testnet).
Was this helpful?
