Sanity Library Reference Docs
    Preparing search index...
    • Prefixes live event tags according to the conventions used by defineLive().sanityFetch() so that they can be used with import {updateTag} from 'next/cache'.

      Parameters

      • unsafeTags: unknown

      Returns ParsedTags

      import {updateTag} from 'next/cache'
      import {parseTags} from 'next-sanity/live'
      import {SanityLive} from '#sanity/live

      <SanityLive
      action={async (event, context) => {
      'use server'

      for (const tag of parseTags(event.tags, context)) {
      updateTag(tag)
      }
      }}
      />