> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# EnhancementsService

**Published**: 2026-11-30
**Category**: Services

Adds browser behavior to HTML rendered from Lynkow content, accessible via
`lynkow.enhancements`: copy buttons on code blocks, inline script execution,
height sync for embedded Lynkow widgets, and CSS that keeps inline text
alignment. The client starts it in the browser, and it also enhances content
added later. Every method is a no-op on the server.

Restyle code blocks by overriding the `--lynkow-code-*` CSS custom
properties. A `light` class or `data-theme="light"` on `<html>` selects the
light variant.

Access via: `lynkow.enhancements`

## Methods

**3** methods

### `destroy`

```typescript
destroy(): void
```

Stops every enhancement and removes the styles and script copies the
service added to `<head>`. Safe to call repeatedly, and `init()` starts
the enhancements again.

Returns: `void`

```typescript
useEffect(() => {
  lynkow.enhancements.init()
  return () => lynkow.enhancements.destroy()
}, [])
```

---

### `init`

```typescript
init(options: EnhancementsInitOptions): void
```

Starts the enhancements on the page and on content added later. The client
calls it in the browser just after `createClient()` returns. Later calls do
nothing until `destroy()`, so to change the options after startup call
`destroy()`, then `init(options)`.

| Parameter | Type | Description |
| --- | --- | --- |
| `options` | `EnhancementsInitOptions` | `codeBlocks` and `activateScripts` toggles, see EnhancementsInitOptions |


Returns: `void`

```typescript
// Your own highlighter renders code blocks.
lynkow.enhancements.destroy()
lynkow.enhancements.init({ codeBlocks: false })
```

---

### `isInitialized`

```typescript
isInitialized(): boolean
```

Returns `true` once `init()` has run, until `destroy()`. Always `false` on
the server.

Returns: `boolean`

```typescript
if (!lynkow.enhancements.isInitialized()) {
  lynkow.enhancements.init()
}
```