This is a plugin for Analytics, a lightweight open-source frontend analytics abstraction layer. The plugin enables sending data to Web3 Analytics, a decentralized analytics platform for web3 apps.
npm install analytics
npm install analytics-plugin-web3analytics
import Analytics from 'analytics';
import web3Analytics from 'analytics-plugin-web3analytics';
/* Initialize analytics & load plugins */
const analytics = Analytics({
app: 'awesome-app',
plugins: [
web3Analytics({
appId: YOUR_WEB3ANALYTICS_APP_ID,
jsonRpcUrl: 'https://eth-goerli.g.alchemy.com/v2/your_key_here',
loglevel: 'error'
})
]
})
'loglevel' is an optional attribute and can be set to 'debug', 'info', 'warn' or 'error'.
More on how to get an appId and use Web3 Analytics here.
Apache-2.0 OR MIT