Configure Wallet Visibility
In this tutorial, you will learn how to set up Arcana Wallet and control the user's experience of signing blockchain transactions in a dApp.
When using a Web3 application, users usually need to confirm each blockchain action by clicking on the Arcana Wallet screen to approve or reject the transaction. The Arcana Auth SDK allows developers to customize the user experience of signing transactions through the embedded Arcana Wallet by selecting the appropriate wallet visibility mode. Developers can specify the Arcana Wallet visibility mode through the alwaysVisible
parameter when integrating the application with the Auth SDK.
Prerequisites
- Make sure you can access Arcana Developer Dashboard: https://dashboard.arcana.network
- Register and configure your application.
Integrate and Initialize Auth SDK
Follow instructions here to integrate Auth SDK in your dApp. During AuthProvider
instantiation, make sure you set the alwaysVisible
input parameter to one of the following values as per the required dApp user experience for signing blockchain transactions:
- Widget,
alwaysVisible = false
- Full UI,
alwaysVisible = true
(default)
For more details on the choice of alwaysVisible
at the time of initializing the Auth SDK affects the dApp user's blockchain transaction signing experience, refer to how Arcana wallet visibility mode works section of the documentation.
Tip
For details regarding alwaysVisible
, see: Auth SDK Reference Guide
The sample code here shows how to enable Widget mode while initializing the Auth SDK:
const { AuthProvider } = window.arcana.auth // From CDN
//or
import { AuthProvider, CHAIN } from '@arcana/auth' //From npm
const appAddress = '445007f942f9Ba718953094BbeeeeeB9484cAfd2' // App Address Example
const auth = new AuthProvider(`${appAddress}`, {
position: 'left', // defaults to right
theme: 'light', // defaults to dark
alwaysVisible: false, // defaults to true which is Full UI mode
chainConfig: {
chainId: CHAIN.POLYGON_MAINNET,
rpcUrl: '',
},
})
try {
await auth.init()
} catch (e) {
// Handle exception case
}
That's it!
You are all set with the Arcana wallet visibility mode configuration to manage the user blockchain signing experience.
What's Next?
Once you have configured the Auth SDK wallet visibility, you can allow authenticated users to access the Arcana wallet for signing blockchain transactions on any EVM-compatible network.