If you're new to Moralis, check the quickstart guide in the official docs on how to get started.
Install the package via npm
:
npm install @moralisweb3/analytics
Import Moralis Analytics:
import { Analytics } from '@moralisweb3/analytics';
const analytics = new Analytics('MORALIS_LIVE_KEY');
In the callback method of your authentication flow simply invoke the analytics.address
method with the users address and any optional metadata.
analytics.address(account.address, { provider: account.connector?.name });
// OR simply
analytics.address(account.address);