sanity-plugin-plausible-analytics
v1.0.0
Published
Access your plausible analytics in sanity studio.
Downloads
444
Readme
sanity-plugin-plausible-analytics
This is a Sanity Studio v3 plugin. Inspired by https://www.sanity.io/plugins/plausible-iframe for v2.
Plausible configuration
- Create a shared link without password protection.
- Add the shared link to the plugin configuration.
Installation
npm install sanity-plugin-plausible-analytics
Usage
Add it as a plugin inside the dashboardTool in sanity.config.ts
(or .js):
import {defineConfig} from 'sanity'
import {dashboardTool} from '@sanity/dashboard'
import {plausibleWidget} from 'sanity-plugin-plausible-analytics'
export default defineConfig({
//...
plugins: [
dashboardTool({
widgets: [
plausibleWidget({
url: '<https://plausible.io/share/your-project?auth=xxxx>',
}),
],
}),
],
})
Options
url
- Required - the shared link from plausibletitle
- Optional - defaults to 'Plausible Analytics'height
- Optional - defaults to 'calc(100vh - 143px)'
License
MIT © Stijn
Develop & test
This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.
See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.