> ## Documentation Index
> Fetch the complete documentation index at: https://dripart-docs-custom-nodes-sdk-v2-frontend.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Reference overview

> Quickly find V2 frontend imports, pack layout, common patterns, API rules, and generated JavaScript signatures.

Use this section when you already understand the V2 model and need an exact import, signature, rule, or API surface.

## Imports

```javascript theme={null}
import { comfy } from '/comfy/api/v2.js'
```

`comfy.version` reports the contract as `major.minor`. Keep a released pack on a supported major with `comfy.forMajor()`.

## Pack layout

```text theme={null}
my_pack/
├── <complete V1 distribution>
└── v2/
    └── <complete V2 replacement distribution>
```

The top level remains the V1 pack root. `v2/` is the V2 pack root, not a patch directory. V2 does not merge with or fall back to V1.

## Minimal JavaScript pattern

```javascript theme={null}
import { comfy } from '/comfy/api/v2.js'

comfy.require('defs.extend')

comfy.defs.extend('Example_Node', (definition) => {
  definition.onCreated((node) => {
    node.addBadge(() => ({ text: 'V2' }))
  })
})
```

## Core rules

| Rule                             | Meaning                                                                                  |
| -------------------------------- | ---------------------------------------------------------------------------------------- |
| Treat returned data as snapshots | Ask the API again when current frontend state matters.                                   |
| Check `isDeleted` before reuse   | A handle can outlive the node, widget, or document session it describes.                 |
| Mutate through handles           | Use documented methods so validation, events, undo, and serialization remain consistent. |
| Probe optional capabilities      | Use `supports()` for enhancements and `require()` for hard dependencies.                 |
| Avoid private monkeypatches      | Private server or web-page internals are not part of the versioned API contract.         |

## JavaScript reference

* [Core API and capabilities](/custom-nodes/v2/reference/javascript-core)
* [Definitions and lifecycle](/custom-nodes/v2/reference/javascript-definitions)
* [Documents and graphs](/custom-nodes/v2/reference/javascript-documents-graphs)
* [Execution and queueing](/custom-nodes/v2/reference/javascript-execution)
* [Settings and storage](/custom-nodes/v2/reference/javascript-settings-storage)
* [Slots and links](/custom-nodes/v2/reference/javascript-slots)
* [UI and widgets](/custom-nodes/v2/reference/javascript-ui-widgets)
* [Workflow data and serialization](/custom-nodes/v2/reference/javascript-workflow)

## When something is missing

Report the user-visible behavior, affected JavaScript surface, current workaround, and why existing APIs are insufficient. New capabilities and extension points can be added for legitimate author needs. Keep any temporary private integration optional and local-only.
