Sanity Library Reference Docs
    Preparing search index...

    Interface EnableLiveModeOptions

    interface EnableLiveModeOptions {
        allowStudioOrigin?: string;
        client?: SanityClient | SanityStegaClient;
        onConnect?: () => void;
        onDisconnect?: () => void;
        onPerspective?: (
            perspective:
                | "previewDrafts"
                | "published"
                | "drafts"
                | StackablePerspective[],
        ) => void;
    }
    Index

    Properties

    allowStudioOrigin?: string

    -- no longer needed

    client?: SanityClient | SanityStegaClient

    You may use any client that is an instanceof SanityClient or instanceof SanityStegaClient. Required when ssr: true, optional otherwise.

    `import {createClient} from '@sanity/client'`
    
    `import {createClient} from '@sanity/client/stega'`
    
    `import {createClient} from '@sanity/preview-kit/client'`
    
    `import {createClient} from 'next-sanity'`
    
    onConnect?: () => void

    Fires when a connection is established to a parent Studio window.

    onDisconnect?: () => void

    Fires when a connection is established to a parent Studio window and then lost.

    onPerspective?: (
        perspective:
            | "previewDrafts"
            | "published"
            | "drafts"
            | StackablePerspective[],
    ) => void

    Fires when the perspective changes in the Studio, allowing you to persist the change to a session cookie if needed