sanity-plugin-ab-testing
v0.1.1
Published
Define A/B tests in Sanity by creating content variants directly in the CMS.
Readme
sanity-plugin-ab-testing
Installation
npm install sanity-plugin-ab-testingUsage
In sanity.config.ts:
import {defineConfig} from 'sanity'
import {abObjectCloningPlugin} from 'sanity-plugin-ab-testing'
export default defineConfig({
plugins: [abObjectCloningPlugin()],
})In your schema index:
import type {SchemaTypeDefinition} from 'sanity'
import {withAbObject} from 'sanity-plugin-ab-testing'
import {postType} from './post'
export const schema: {types: SchemaTypeDefinition[]} = {
types: [withAbObject(postType)],
}License
MIT © Marko Bilanović
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.
