This is a Sanity Studio v3 plugin. Inspired by https://www.sanity.io/plugins/plausible-iframe for v2.
- Create a shared link without password protection.
- Add the shared link to the plugin configuration.
npm install sanity-plugin-plausible-analytics
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',
}),
],
}),
],
})
url
- Required - the shared link from plausibletitle
- Optional - defaults to 'Plausible Analytics'height
- Optional - defaults to 'calc(100vh - 143px)'
MIT © Stijn
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.