Socket
Book a DemoInstallSign in
Socket

@tinloof/sanity-amplitude-experiment

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinloof/sanity-amplitude-experiment

A plugin to easily connect your Amplitude experiments with your Sanity documents.

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
2
Created
Source

@tinloof/sanity-amplitude-experiment

A plugin to easily connect your Amplitude experiments with your Sanity documents.

Installation

npm install @tinloof/sanity-amplitude-experiment

Requirements

  • A Sanity project
  • An Amplitude account (Growth plan)
  • An Amplitude Management API key

Basic usage

1. Configure the plugin in sanity.config.ts

import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
import {amplitudeExperiment} from '@tinloof/sanity-amplitude-experiment'
import schemas from './schemas'

const projectId = process.env.SANITY_STUDIO_PROJECT_ID || ''
const dataset = process.env.SANITY_STUDIO_DATASET || ''

export default defineConfig({
  projectId,
  dataset,
  plugins: [structureTool(), amplitudeExperiment()],
  schema: {
    types: schemas,
  },
})

2. Add the amplitude-experiment field to your document

import {defineField, defineType} from 'sanity'

export default defineType({
  type: 'document',
  name: 'page',
  fields: [
    defineField({
      type: 'string',
      name: 'title',
      group: 'content',
    }),
    defineField({
      name: 'experiment',
      type: 'amplitude-experiment',
    }),
  ],
})

3. Configure your Management API key

Keywords

sanity

FAQs

Package last updated on 10 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts