Skip to content

Configure Wallet Visibility

In this tutorial, you will learn how to integrate an app with the Arcana Auth SDK and control the user's experience of signing blockchain transactions via the Arcana Wallet.

Prerequisites

Integrate and Initialize Auth SDK

Follow the instructions 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:

  • alwaysVisible = true(default): The wallet UI is always visible once the user logs in.
  • alwaysVisible = false: The wallet UI is displayed only when a blockchain transaction requires the user's approval.

For more details, see how wallet visibility works.

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
//clientId : Arcana Unique App Identifier via Dashboard
const clientId = 'xar_test_445007f942f9Ba718953094BbeeeeeB9484cAfd2'
const auth = new AuthProvider(`${clientId}`, { //required
  network: 'testnet', //defaults to 'testnet'
  position: 'left', //defaults to right
  theme: 'light', //defaults to dark
  alwaysVisible: false, //defaults to true, wallet always visible
  chainConfig: {
    chainId: CHAIN.POLYGON_MAINNET, //defaults to CHAIN.ETHEREUM_MAINNET
    rpcUrl: 'https://polygon-rpc.com', //defaults to 'https://rpc.ankr.com/eth'
  },
})
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 supported blockchain network.

See also


Last update: March 14, 2023 by shaloo