{
  "component": {
    "id": "developer-portal-template",
    "name": "Developer portal template",
    "tier": "pro",
    "exampleId": "developer-portal-template",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/developer-portal-template-demo.tsx",
    "exportName": "DeveloperPortalTemplateDemo",
    "sha256": "f3ebbe37e7677d00d7a88791b3855ab0ebbc5af0147492b21c77a4b2c7f8224b",
    "helperImports": [],
    "directComponentImports": [
      "api-key-manager",
      "developer-portal-template",
      "tidal-button",
      "usage-limits",
      "webhook-manager"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/developer-portal-template",
    "registryUrl": "https://tidalui.com/r/pro/developer-portal-template.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/developer-portal-template",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/developer-portal-template",
      "registryUrl": "https://tidalui.com/r/pro/developer-portal-template.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    },
    {
      "order": 2,
      "kind": "demo-only-additional",
      "dependency": "https://tidalui.com/r/tidal-button.json",
      "purpose": "complete-example-demo-dependency",
      "command": "npx shadcn@latest add https://tidalui.com/r/tidal-button.json",
      "registryUrl": "https://tidalui.com/r/tidal-button.json",
      "access": "free",
      "sourceDelivery": "public-registry",
      "requiresAuthorization": false
    }
  ],
  "imports": {
    "componentPath": "components/ui/developer-portal-template.tsx",
    "exports": [
      "TidalApiKeyRecord",
      "TidalButton",
      "TidalDeveloperPortalTemplate",
      "TidalUsageMetric",
      "TidalWebhookEndpoint",
      "TidalWebhookEndpointForm"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/developer-portal-template.css",
      "components/ui/api-key-manager.css",
      "components/ui/webhook-manager.css",
      "components/ui/usage-limits.css",
      "components/ui/code-block.css",
      "components/ui/status-badge.css",
      "components/ui/toggle-switch.css",
      "components/ui/collapsible-panel.css",
      "components/ui/meter.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "@tidal-pro/code-block",
      "@tidal-pro/api-key-manager",
      "@tidal-pro/webhook-manager",
      "@tidal-pro/usage-limits"
    ],
    "additionalRegistry": [
      "https://tidalui.com/r/tidal-button.json"
    ],
    "installClosure": [
      "api-key-manager",
      "code-block",
      "collapsible-panel",
      "developer-portal-template",
      "meter",
      "status-badge",
      "tidal-button",
      "toggle-switch",
      "usage-limits",
      "webhook-manager"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/developer-portal-template.css",
      "components/ui/api-key-manager.css",
      "components/ui/webhook-manager.css",
      "components/ui/usage-limits.css",
      "components/ui/code-block.css",
      "components/ui/status-badge.css",
      "components/ui/toggle-switch.css",
      "components/ui/collapsible-panel.css",
      "components/ui/meter.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/developer-portal-template.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/developer-portal-template-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useLayoutEffect, useRef, useState } from \"react\";\n\nimport { TidalDeveloperPortalTemplate } from \"./components/ui/developer-portal-template\";\n\nimport type { TidalApiKeyRecord } from \"./components/ui/api-key-manager\";\n\nimport { TidalWebhookEndpointForm, type TidalWebhookEndpoint } from \"./components/ui/webhook-manager\";\n\nimport type { TidalUsageMetric } from \"./components/ui/usage-limits\";\n\nimport { TidalButton } from \"./components/ui/tidal-button\";\n\nimport \"./components/ui/api-key-manager.css\";\n\nimport \"./components/ui/webhook-manager.css\";\n\nimport \"./components/ui/usage-limits.css\";\n\nimport \"./components/ui/developer-portal-template.css\";\n\nimport \"./components/ui/code-block.css\";\n\nimport \"./components/ui/status-badge.css\";\n\nimport \"./components/ui/toggle-switch.css\";\n\nimport \"./components/ui/collapsible-panel.css\";\n\nimport \"./components/ui/meter.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .tidal-developer-portal-confirmation {\\n  display: grid;\\n  gap: 10px;\\n  margin-block-start: 14px;\\n  padding: 12px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 10px;\\n  background: var(--t-subtle);\\n}\\n.tidal-scope .tidal-developer-portal-confirmation p {\\n  margin: 0;\\n  font-size: 12px;\\n  line-height: 1.5;\\n  overflow-wrap: anywhere;\\n}\\n.tidal-scope .tidal-developer-portal-confirmation > div {\\n  display: flex;\\n  flex-wrap: wrap;\\n  gap: 8px;\\n}\";\n\nconst INITIAL_KEYS: TidalApiKeyRecord[] = [\n  {\n    id: \"key-sample-1\",\n    name: \"Local development\",\n    maskedValue: \"tidal_sample_••••7F2A\",\n    scopes: [\"projects:read\", \"events:read\"],\n    status: \"active\",\n    created: { label: \"October 12, 2026\", dateTime: \"2026-10-12\" },\n    lastUsed: { label: \"Sample activity 18 minutes ago\" },\n  },\n  {\n    id: \"key-sample-2\",\n    name: \"Reporting preview\",\n    maskedValue: \"tidal_sample_••••1C09\",\n    scopes: [\"reports:read\"],\n    status: \"active\",\n    created: { label: \"October 4, 2026\", dateTime: \"2026-10-04\" },\n  },\n];\n\nconst INITIAL_ENDPOINTS: TidalWebhookEndpoint[] = [\n  {\n    id: \"endpoint-sample\",\n    name: \"Local event receiver\",\n    url: \"https://example.test/hooks/tidal\",\n    enabled: true,\n    signing: \"configured\",\n    events: [\"project.updated\", \"report.ready\"],\n    deliveriesOpen: false,\n    deliveries: [\n      {\n        id: \"delivery-sample\",\n        event: \"project.updated\",\n        outcome: \"delivered\",\n        time: { label: \"Sample delivery at 2:14 PM\" },\n        response: \"204 sample response\",\n        duration: \"184 ms\",\n      },\n    ],\n  },\n];\n\nconst WEEKLY_USAGE: readonly TidalUsageMetric[] = [\n  {\n    id: \"requests\",\n    kind: \"metered\",\n    label: \"API requests\",\n    value: 18420,\n    limit: 50000,\n    valueText: \"18,420\",\n    limitText: \"50,000\",\n    reset: { label: \"Sample period resets Monday\" },\n  },\n  {\n    id: \"events\",\n    kind: \"metered\",\n    label: \"Webhook events\",\n    value: 2100,\n    limit: 10000,\n    valueText: \"2,100\",\n    limitText: \"10,000\",\n  },\n];\n\nconst MONTHLY_USAGE: readonly TidalUsageMetric[] = [\n  {\n    id: \"requests\",\n    kind: \"metered\",\n    label: \"API requests\",\n    value: 74600,\n    limit: 200000,\n    valueText: \"74,600\",\n    limitText: \"200,000\",\n    reset: { label: \"Sample period resets November 1\" },\n  },\n  {\n    id: \"events\",\n    kind: \"metered\",\n    label: \"Webhook events\",\n    value: 8600,\n    limit: 40000,\n    valueText: \"8,600\",\n    limitText: \"40,000\",\n  },\n];\n\nconst WEBHOOK_EVENTS = [\n  { value: \"project.updated\", label: \"Project updated\" },\n  { value: \"report.ready\", label: \"Report ready\" },\n  { value: \"workspace.created\", label: \"Workspace created\" },\n] as const;\n\nexport function DeveloperPortalTemplateDemo() {\n  const [keys, setKeys] = useState(INITIAL_KEYS);\n  const [endpoints, setEndpoints] = useState(INITIAL_ENDPOINTS);\n  const [period, setPeriod] = useState<\"week\" | \"month\">(\"week\");\n  const [pendingRevokeId, setPendingRevokeId] = useState<string>();\n  const [editingEndpointId, setEditingEndpointId] = useState<string | null>(\n    null,\n  );\n  const [endpointValues, setEndpointValues] = useState({\n    name: \"\",\n    url: \"\",\n    events: [] as readonly string[],\n  });\n  const [status, setStatus] = useState(\"Developer sample ready.\");\n  const createKeyRef = useRef<HTMLButtonElement>(null);\n  const createEndpointRef = useRef<HTMLButtonElement>(null);\n  const endpointOpenerRef = useRef<HTMLButtonElement | null>(null);\n  const endpointNameRef = useRef<HTMLInputElement>(null);\n  const localRecordSequence = useRef(1);\n  const pendingRevoke = keys.find((record) => record.id === pendingRevokeId);\n\n  useLayoutEffect(() => {\n    if (editingEndpointId === null) return;\n    const input = endpointNameRef.current;\n    const ownerWindow = input?.ownerDocument.defaultView;\n    if (!input || !ownerWindow) return;\n    const frame = ownerWindow.requestAnimationFrame(() => {\n      input.focus({ preventScroll: true });\n      input.scrollIntoView({ block: \"nearest\", inline: \"nearest\" });\n    });\n    return () => ownerWindow.cancelAnimationFrame(frame);\n  }, [editingEndpointId]);\n\n  const returnToKeyManager = () => {\n    queueMicrotask(() => createKeyRef.current?.focus({ preventScroll: true }));\n  };\n  const closeEndpointEditor = () => {\n    setEditingEndpointId(null);\n    queueMicrotask(() =>\n      (endpointOpenerRef.current ?? createEndpointRef.current)?.focus({\n        preventScroll: true,\n      }),\n    );\n  };\n\n  return (\n    <TidalDeveloperPortalTemplate\n      title=\"Build with the workspace API\"\n      eyebrow=\"Developer portal\"\n      description=\"Follow the quickstart, inspect sample credentials, configure a local webhook, and review supplied usage readings.\"\n      quickstartDescription=\"Review a fictional client setup. The code is displayed and never executed.\"\n      quickstart={{\n        filename: \"quickstart.ts\",\n        language: \"TypeScript\",\n        code: `const client = createWorkspaceClient({\\n  endpoint: \"https://api.example.test\",\\n  token: \"YOUR_KEY\",\\n});\\n\\nconst projects = await client.projects.list();`,\n        caption:\n          \"Replace the sample endpoint and token in your own environment.\",\n        maxHeight: 260,\n      }}\n      apiKeys={{\n        title: \"API keys\",\n        description: \"Masked fictional metadata for this preview.\",\n        keys,\n        createButtonRef: createKeyRef,\n        onCreateRequest: () => {\n          const sampleId = \"key-local-created\";\n          if (keys.some((record) => record.id === sampleId)) {\n            setStatus(\"The local sample key is already visible.\");\n            return;\n          }\n          setKeys((items) => [\n            ...items,\n            {\n              id: sampleId,\n              name: \"New local sample\",\n              maskedValue: \"tidal_sample_••••8B14\",\n              scopes: [\"projects:read\"],\n              status: \"active\",\n              created: { label: \"Created in this preview\" },\n              lastUsed: { label: \"Never used\" },\n            },\n          ]);\n          setStatus(\n            \"A masked fictional key record was added locally. No credential was generated.\",\n          );\n        },\n        onRevokeRequest: (record) => {\n          setPendingRevokeId(record.id);\n          setStatus(`Confirm the local revoke for ${record.name}.`);\n        },\n        dialog: pendingRevoke ? (\n          <section\n            className=\"tidal-developer-portal-confirmation\"\n            aria-label=\"Confirm sample key revocation\"\n          >\n            <p>\n              Mark <strong>{pendingRevoke.name}</strong> revoked in this local\n              sample?\n            </p>\n            <div>\n              <TidalButton\n                type=\"button\"\n                variant=\"primary\"\n                onClick={() => {\n                  setKeys((items) =>\n                    items.map((item) =>\n                      item.id === pendingRevoke.id\n                        ? { ...item, status: \"revoked\" }\n                        : item,\n                    ),\n                  );\n                  setStatus(\n                    `${pendingRevoke.name} was marked revoked in local sample state.`,\n                  );\n                  setPendingRevokeId(undefined);\n                  returnToKeyManager();\n                }}\n              >\n                Confirm local revoke\n              </TidalButton>\n              <TidalButton\n                type=\"button\"\n                variant=\"secondary\"\n                onClick={() => {\n                  setPendingRevokeId(undefined);\n                  setStatus(\"Local revoke canceled.\");\n                  returnToKeyManager();\n                }}\n              >\n                Keep key\n              </TidalButton>\n            </div>\n          </section>\n        ) : null,\n      }}\n      webhooks={{\n        title: \"Webhooks\",\n        description:\n          \"One fictional endpoint and exact supplied delivery metadata.\",\n        endpoints,\n        createButtonRef: createEndpointRef,\n        onCreateRequest: (event) => {\n          endpointOpenerRef.current = event.currentTarget;\n          setEndpointValues({ name: \"\", url: \"\", events: [] });\n          setEditingEndpointId(\"new\");\n          setStatus(\"Complete the local endpoint form.\");\n        },\n        onEnabledChange: (endpoint, enabled) => {\n          setEndpoints((items) =>\n            items.map((item) =>\n              item.id === endpoint.id ? { ...item, enabled } : item,\n            ),\n          );\n          setStatus(\n            `${endpoint.name} is ${enabled ? \"enabled\" : \"paused\"} in local sample state.`,\n          );\n        },\n        onTestRequest: (endpoint) => {\n          const id = `local-delivery-${localRecordSequence.current++}`;\n          setEndpoints((items) =>\n            items.map((item) =>\n              item.id === endpoint.id\n                ? {\n                    ...item,\n                    deliveriesOpen: true,\n                    deliveries: [\n                      {\n                        id,\n                        event: \"webhook.test\",\n                        outcome: \"delivered\",\n                        time: { label: \"Just now · local sample\" },\n                        response: \"204 sample response\",\n                        duration: \"96 ms\",\n                      },\n                      ...item.deliveries,\n                    ],\n                  }\n                : item,\n            ),\n          );\n          setStatus(\n            `A fictional delivery was added for ${endpoint.name}. No network request was sent.`,\n          );\n        },\n        onEditRequest: (endpoint, event) => {\n          endpointOpenerRef.current = event.currentTarget;\n          setEndpointValues({\n            name: endpoint.name,\n            url: endpoint.url,\n            events: endpoint.events,\n          });\n          setEditingEndpointId(endpoint.id);\n          setStatus(`Edit ${endpoint.name} in the local form.`);\n        },\n        onDeliveriesOpenChange: (endpoint, open) =>\n          setEndpoints((items) =>\n            items.map((item) =>\n              item.id === endpoint.id\n                ? { ...item, deliveriesOpen: open }\n                : item,\n            ),\n          ),\n        editor:\n          editingEndpointId !== null ? (\n            <TidalWebhookEndpointForm\n              nameInputRef={endpointNameRef}\n              nameValue={endpointValues.name}\n              urlValue={endpointValues.url}\n              selectedEvents={endpointValues.events}\n              eventOptions={WEBHOOK_EVENTS}\n              onValueChange={setEndpointValues}\n              onCancel={closeEndpointEditor}\n              onSubmit={(event) => {\n                event.preventDefault();\n                const name = endpointValues.name.trim();\n                const endpointId =\n                  editingEndpointId === \"new\"\n                    ? `endpoint-local-${localRecordSequence.current++}`\n                    : editingEndpointId;\n                setEndpoints((items) =>\n                  editingEndpointId === \"new\"\n                    ? [\n                        ...items,\n                        {\n                          id: endpointId,\n                          name,\n                          url: endpointValues.url,\n                          enabled: false,\n                          signing: \"not-configured\",\n                          events: endpointValues.events,\n                          deliveries: [],\n                          deliveriesOpen: false,\n                        },\n                      ]\n                    : items.map((item) =>\n                        item.id === editingEndpointId\n                          ? {\n                              ...item,\n                              name,\n                              url: endpointValues.url,\n                              events: endpointValues.events,\n                            }\n                          : item,\n                      ),\n                );\n                setStatus(`${name} was saved in local sample state.`);\n                closeEndpointEditor();\n              }}\n            />\n          ) : undefined,\n      }}\n      usage={{\n        title: \"Usage\",\n        description: `Fictional ${period === \"week\" ? \"weekly\" : \"monthly\"} allowance readings.`,\n        metrics: period === \"week\" ? WEEKLY_USAGE : MONTHLY_USAGE,\n        action: (\n          <TidalButton\n            type=\"button\"\n            variant=\"secondary\"\n            onClick={() => {\n              setPeriod((value) => (value === \"week\" ? \"month\" : \"week\"));\n              setStatus(\"Local usage period changed.\");\n            }}\n          >\n            Show {period === \"week\" ? \"month\" : \"week\"}\n          </TidalButton>\n        ),\n      }}\n      footer={\n        <>\n          <strong role=\"status\">{status}</strong>\n          <span>\n            {\" \"}\n            Fictional records only. No credential, webhook, request, account, or\n            usage service is connected.\n          </span>\n        </>\n      }\n    />\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <DeveloperPortalTemplateDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/developer-portal-template.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [],
  "events": [
    {
      "name": "onCancel",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onClick",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onSubmit",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onValueChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": false,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": true,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Existing demo label or ARIA prop",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Verify focus returns to the invoking control after dismissal.",
    "errorAnnouncement": "The existing error or alert path remains consumer-owned and should be announced by the rendered semantics.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "Exercise the existing demo's error, empty, loading, or invalid fixture.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
