Sanity Library Reference Docs
    Preparing search index...

    Function defineContextKnowledgeBase

    • Beta

      Defines a Context knowledge base.

      Parameters

      • parameters: BlueprintContextKnowledgeBaseConfig

        The knowledge base configuration

        Deploying Context via Blueprints is experimental. This feature is stabilizing but may still be subject to breaking changes.

        Configuration for a Context knowledge base. This feature is subject to breaking changes.

        • Betadescription: string

          What the knowledge base covers, up to 2,000 characters.

        • Betaname: string

          The resource name in the blueprint. The knowledge base has no name, only a title. With the default deletion policy (retain), a deploy fails if this name changes.

        • Betatitle: string

          The knowledge base title, up to 100 characters.

      Returns BlueprintContextKnowledgeBaseResource

      The knowledge base resource

      The blueprint must be scoped to an organization. A new knowledge base has no sources. Add sources in the Context API or the dashboard.

      The default deletion policy is retain. If the stack is destroyed, the knowledge base is detached and not deleted. If the resource is removed from the blueprint, the deploy fails. To remove the resource, first deploy it with one of these lifecycle values:

      • {ownershipAction: {type: 'detach'}} keeps the knowledge base.
      • {deletionPolicy: 'allow'} deletes the knowledge base.
      defineContextKnowledgeBase({
      name: 'product-docs',
      title: 'Product docs',
      description: 'Everything about the product',
      })
      defineContextKnowledgeBase({
      name: 'product-docs',
      title: 'Product docs',
      description: 'Everything about the product',
      lifecycle: {ownershipAction: {type: 'detach'}},
      })