Integrate Vue App
Estimated time to read: 2 minutes
Integrate 'Vue' apps withArcana Auth SDK and onboard users via social login. Enable users to sign blockchain transactions with the in-app Arcana wallet.
Prerequisites
- Register the 'Vue' app and configure SDK usage settings for social login providers, manage app manage app chains and wallet user experience.
Non-EVM Chains
When registering an app through Arcana Developer Dashboard, the choice of chain type (EVM, Solana, MultiversX, Near) is final. App developers can't change it later. They can switch the default chain within the same type. For example, a Solana app on Testnet can switch to Solana Mainnet or Solana Dev but not to MultiversX or an EVM chain.
Steps
1. Install
npm install --save @arcana/auth
yarn add @arcana/auth
2. Initialize AuthProvider
import { AuthProvider } from "@arcana/auth";
let authInstance;
//Mainnet ClientId
const clientId = "xar_live_d7c88d9b033d100e4200d21a5c4897b896e60063";
if (authInstance == null) {
authInstance = new AuthProvider(clientId);
await authInstance.init();
}
// Use authInstance for user onboarding, JSON/RPC and wallet ops
AuthProvider
Optional Parameters
Besides Client ID input parameter, you can optionally customize these settings in the AuthProvider
constructor:
position
: wallet position within the app context - left
|right
theme
: wallet theme - light
|dark
connectOptions
: compact mode for the built-in plug-and-play login UI - true
|false
connectOptions: {
compact: true // default - false
},
See AuthProvider
constructor parameters for details.
The 'Vue' Web3 app is now integrated with the Arcana Auth SDK.
What's Next?
Onboard users via the built-in plug-and-play login UI or a custom login UI.
Use AuthProvider
, the EIP-1193 provider offered by the SDK, to call supported JSON/RPC functions and Web3 wallet operations in the authenticated user's context.
See also
'Vue' integration example: See sample-auth-vue
submodule in Auth Examples
Arcana Auth SDK Quick Links