Sanity Library Reference Docs
    Preparing search index...

    Interface DocumentResolverContext

    Context object passed to functions used in DocumentResolver definitions. Contains information about the current URL being matched against route patterns.

    For a route pattern /blog/:category/:slug matching URL https://example.com/blog/tech/hello-world:

    {
    origin: 'https://example.com',
    params: { category: 'tech', slug: 'hello-world' },
    path: '/blog/tech/hello-world'
    }
    interface DocumentResolverContext {
        origin: string;
        params: Record<string, string>;
        path: string;
    }
    Index

    Properties

    Properties

    origin: string

    The origin (protocol + hostname + port) of the matched URL

    params: Record<string, string>

    Extracted route parameters from URL path matching (e.g., :slug{slug: 'value'})

    path: string

    The pathname of the matched URL (without query parameters)