Sanity Library Reference Docs
    Preparing search index...
    SanityLiveAction:
        | ((unsafeTags: unknown) => Promise<void | "refresh">)
        | "refresh"

    Server action invoked when Sanity Live receives a content-change message.

    The argument is the list of cache tags derived from the Live Content API event. The default action revalidates those tags. Return 'refresh' from a custom action to also call router.refresh() in the browser.

    There's three types of values you can give action:

    • 'use server'; export async function action() {}
    • 'use client'; export async function action() {}
    • 'refresh'

    If you give the string 'refresh', it's the same as if the action just async () => 'refresh', which leads to calling router.refresh() for you