OpenForm
AITools

getRegistry

Last updated on

Fetch registry.json from a URL, returns available artifacts

Fetches registry.json from a registry URL and returns the list of available artifacts.

Parameters

ParameterTypeRequiredDescription
registryUrlstringYesRegistry base URL (e.g. https://public.open-form.dev)

Response

FieldTypeDescription
namestringThe registry URL
artifactsPathstringBase path for artifact files within the registry
itemsarrayList of artifacts, each with name and optional path
errorstringError message if the fetch failed

Direct usage

import { executeGetRegistry } from "@open-form/ai-tools"

const result = await executeGetRegistry({
  registryUrl: "https://public.open-form.dev",
})
// {
//   name: "https://public.open-form.dev",
//   items: [
//     { name: "pet-addendum", path: "pet-addendum/pet-addendum.json" },
//     { name: "w-9", path: "w-9/w-9.json" },
//   ]
// }

Example response

{
  "name": "https://public.open-form.dev",
  "items": [
    {
      "name": "pet-addendum",
      "path": "pet-addendum/pet-addendum.json"
    },
    {
      "name": "w-9",
      "path": "w-9/w-9.json"
    }
  ]
}

On this page