Skip to main content

Connect a Universal Profile

To interact with a Universal Profile, we recommend your dApp to call the window.lukso object within the browser. Before a connection can be established, users have to create their Universal Profile by:

  1. Installing the Universal Profile Browser Extension
  2. Deploying their Universal Profile
Wallet Compatibility

Alternatively to calling the window.lukso object, the equivalent window.ethereum object can be called within supported browsers, just like other Ethereum wallets.

Manual Deployment

You can also create new Universal Profiles by ⚒ïļ deploying them programmatically. However, please keep in mind that you would also have to deploy your own Transaction Relay Service to allow gasless onboarding. Customly deployed profiles will not receive free monthly transaction quota through the LUKSO Transaction Relay Service.

Connect to a dApp​

Request Handling

The Universal Profile Extension automatically manages incoming requests and returns the address of the connected Universal Profile. To get the conrolling EOAs of the smart contract account, you can manually fetch it's controllers.

npm install ethers
import { ethers } from 'ethers';
const provider = new ethers.BrowserProvider(window.lukso);

const accounts = await provider.send('eth_requestAccounts', []);
console.log('Connected with', accounts[0]);
Example of Sign-In with Ethereum screen

Handle multiple extensions​

If you expect your users to have multiple browser wallets or extensions, we recommend installing Web3 Onboard by following our Web3 Onboard Configuration. The library will allow users to manage multiple browser providers in parallel.

Alternatively, you can use a simple fallback to allow regular wallet connections, if the Universal Profile Browser Extension is not installed:

const providerObject = window.lukso || window.ethereum;
const provider = new ethers.BrowserProvider(providerObject);