> ## Documentation Index
> Fetch the complete documentation index at: https://docs.speckle.systems/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> These docs contain multiple Speckle product experiences. For Speckle 2026.9, prefer /next/ pages for the topics and changes they cover. The navigation label Current does not override this version-specific precedence.
> Coverage under /next/ is incremental. Use Current documentation for unchanged topics and when a /next/ page says coverage is unavailable or explicitly refers you to Current. Do not infer a feature was removed from a missing page.
> Read the page-specific documentation status, applicability, affected guidance and replacement links in agent-only content. Impacted, changed and superseded apply only to the stated scope; they do not mean the entire feature is deprecated. Historical connector guides apply only to the legacy connector described.
> Match guidance to the customer's deployment version, model data format and connector. Respect plan, permission and compatibility restrictions. If an unknown version or data format changes the answer, ask a focused clarification; do not infer deployment version from the date alone.

# DifExtension

> The default diffing functionality expose as an extension.

## Methods

### diff

```typescript theme={null}
async diff(
    urlA: string,
    urlB: string,
    mode: VisualDiffMode,
    authToken?: string
  ): Promise<DiffResult>
```

Diffs the two speckle models provided as URLs. If the models are not yet loaded, they are also loaded.

Parameters:

* **urlA**: The 'current' model
* **urlB**: The 'incoming' model
* **mode**: The [*VisualDiffMode*](/developers/viewer/extensions/diff-extension-api#visualdiffmode)
* *optional* **authToken** Used for potentially loading models

**Returns**: `Promise <`[`_DiffResult_`](/developers/viewer/extensions/diff-extension-api#diffresult)`>`

### undiff

```typescript theme={null}
async undiff(): Promise<void>
```

Undos any visual diffing and unloads any loaded models previously loaded b diffing.

**Returns**: Promise\< void >

### updateVisualDiff

```typescript theme={null}
updateVisualDiff(time?: number, mode?: VisualDiffMode): void
```

Updates the current visual diff.

**Parameters**:

* *optional* **time**: A value between 0 and 1 which that is used to interpolate opacity between 'current' and 'incoming' objects
* *optional* **model**: [*VisualDiffMode*](/developers/viewer/extensions/diff-extension-api#visualdiffmode)

**Returns**: void

## Typedefs

### DiffResult

```typescript theme={null}
interface DiffResult {
  unchanged: Array<TreeNode>
  added: Array<TreeNode>
  removed: Array<TreeNode>
  modified: Array<Array<TreeNode>>
}
```

* **unchanged**: All the nodes considered unchanged
* **added**: All the nodes considered added
* **removed**: All the nodes considered removed
* **modified**: All the nodes considered modified by pairs, where the first node is from the 'current' model and second one is from the 'incoming' model

### VisualDiffMode

```typescript theme={null}
enum VisualDiffMode {
  PLAIN,
  COLORED
}
```

With PLAIN, original materials are kept, and only made transparent. With COLORED the materials are replaced with typical diff colored materials:

* `red` for `removed`
* `yellow` for `modified`
* `green` for `added`
* `no change` for `unchanged`
