@sanity/routes
    Preparing search index...

    Function createRouteSyncHandler

    • Creates a Sanity Function handler that keeps route map shards in sync when routable documents change.

      Parameters

      • channel: string

        The route config channel (e.g., 'web')

      Returns DocumentEventHandler<any>

      A documentEventHandler for use in Sanity Functions

      // studio/functions/route-sync/index.ts
      import { createRouteSyncHandler } from '@sanity/routes'
      export const handler = createRouteSyncHandler('web')