---
title: "DeskCrew · Nuxt Scripts"
description: "Add a lazy-loaded DeskCrew support widget to your Nuxt app."
canonical_url: "https://scripts.nuxt.com/scripts/deskcrew"
meta:
  "og:description": "Add a lazy-loaded DeskCrew support widget to your Nuxt app."
  "og:image": "https://scripts.nuxt.com/_og/s/o_f8426bb41a92a1e1.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "DeskCrew · Nuxt Scripts"
  "twitter:image": "https://scripts.nuxt.com/_og/s/o_f8426bb41a92a1e1.png"
---

> Index of every page on this site: [llms.txt](https://scripts.nuxt.com/llms.txt)

**Scripts**

# **DeskCrew**

[Copy for LLMs](https://scripts.nuxt.com/scripts/deskcrew.md)

[**DeskCrew**](https://deskcrew.io/) is a support widget combining live chat, AI answers from your knowledge base, a help centre and a changelog.

Use [`**useScriptDeskCrew()**`](#usescriptdeskcrew) for direct SDK calls, or [`**<ScriptDeskCrew>**`](#scriptdeskcrew) for a custom chat launcher.

**DeskCrew**

[**View source **](https://github.com/nuxt/scripts/blob/main/packages/script/src/runtime/registry/deskcrew.ts)

## Nuxt Config Setup

Add this to your `**nuxt.config.ts**` to load DeskCrew globally. Alternatively you can use the **useScriptDeskCrew** composable for more control.

```
export default defineNuxtConfig({
  scripts: {
    registry: {
      deskcrew: {
        trigger: 'onNuxtReady',
      }
    }
  }
})
```

## useScriptDeskCrew()

The `**useScriptDeskCrew**` composable lets you have fine-grain control over when and how DeskCrew is loaded on your site.

```
const { proxy } = useScriptDeskCrew()
```

Please follow the [**Registry Scripts **](https://scripts.nuxt.com/docs/guides/registry-scripts) guide to learn more about advanced usage.

## Example

Using DeskCrew in a component.

ConversionButton.vue

```
<script setup lang="ts">
const { proxy } = useScriptDeskCrew()

// noop in development, ssr
// just works in production, client
function handleAction() {
  // use proxy methods here
}
</script>

<template>
  <div>
    <button @click="handleAction">
      Send Event
    </button>
  </div>
</template>
```

## [`**<ScriptDeskCrew>**`](https://scripts.nuxt.com/scripts/deskcrew)

The headless facade holds back the DeskCrew widget until its [**element trigger**](https://scripts.nuxt.com/docs/guides/script-triggers#element-event-triggers) fires. It listens for `**click**` by default, so a visitor who never opens chat downloads none of the widget.

### Component API

See the [**Facade Component API**](https://scripts.nuxt.com/docs/guides/facade-components#facade-components-api) for full props, events, and slots.

#### **With environment variables**

nuxt.config.ts

```ts
export default defineNuxtConfig({
  scripts: {
    registry: {
      deskcrew: { trigger: 'onNuxtReady' },
    }
  },
  runtimeConfig: {
    public: {
      scripts: {
        deskcrew: {
          widgetKey: '', // NUXT_PUBLIC_SCRIPTS_DESKCREW_WIDGET_KEY
          board: '', // NUXT_PUBLIC_SCRIPTS_DESKCREW_BOARD
        },
      },
    },
  },
})
```

.env

```text
NUXT_PUBLIC_SCRIPTS_DESKCREW_WIDGET_KEY=<YOUR_PUBLIC_KEY>
NUXT_PUBLIC_SCRIPTS_DESKCREW_BOARD=<YOUR_BOARD_SLUG>
```

### Events

The component emits `**ready**` once the widget has mounted its launcher, and `**error**` if the script fails to load.

### Slots

`**awaitingLoad**`, `**loading**`, `**error**` and the default slot behave as documented for facade components.

## [`**useScriptDeskCrew()**`](https://scripts.nuxt.com/scripts/deskcrew)

```ts
export function useScriptDeskCrew<T extends DeskCrewApi>(_options?: DeskCrewInput) {}
```

`**widgetKey**``string`** required **

The DeskCrew public widget key, for example \`pub\_xxxxxxxx\`. Rendered as the \`data-key\` attribute. Find it in the DeskCrew dashboard under Install.

`**board**``string`

The workspace board slug, lowercase letters, numbers and dashes only. Rendered as the \`data-board\` attribute. Required for the help centre, changelog and embedded portal surfaces; the chat launcher works without it.

`**color**``string`

Accent colour as a 6 digit hex value, for example \`#4f46e5\`. Rendered as the \`data-color\` attribute. Overrides the accent configured on the workspace.

`**position**``'left' | 'right'` = 'right'

Which side of the viewport the launcher sits on. Rendered as the \`data-position\` attribute.

`**greeting**``string`

Greeting text shown in the widget header, overriding the workspace default. Rendered as the \`data-greeting\` attribute.

`**launcher**``'logo'`

Render the workspace logo in the launcher bubble instead of the default icon. Rendered as the \`data-launcher\` attribute.

### Identifying a visitor

Identity is a signed token minted by your own backend, so it is a runtime call rather than a `**nuxt.config**` option. Everything in `**nuxt.config**` is a deploy-time constant, and baking one visitor's token into a build would hand that identity to every other visitor.

```vue
<script setup lang="ts">
const { proxy } = useScriptDeskCrew({ widgetKey: 'pub_xxxxxxxx' })
const { data } = await useFetch('/api/deskcrew-token')
watchEffect(() => {
  if (data.value?.token)
    proxy.identify({ token: data.value.token })
})
</script>
```

### Other surfaces

`**embed()**`, `**changelog()**` and `**surveys()**` each mount a surface. Call each at most once per page: a second call logs a warning and does nothing.

DeskCrew serves its widget from its own origin and derives its API endpoint from the script's `**src**`, so this script does not support [**bundling**](https://scripts.nuxt.com/docs/guides/bundling) or [**first-party mode**](https://scripts.nuxt.com/docs/guides/first-party). It loads directly from `**deskcrew.io**`.

[Edit this page](https://github.com/nuxt/scripts/edit/main/docs/content/deskcrew.md)

[Markdown For LLMs](https://scripts.nuxt.com/scripts/deskcrew.md)

[**Databuddy Analytics** Load Databuddy's browser SDK and configure its analytics and performance tracking.](https://scripts.nuxt.com/scripts/databuddy-analytics) [**Fathom Analytics** Load Fathom Analytics and track page views, goals, and custom events.](https://scripts.nuxt.com/scripts/fathom-analytics)

**On this page **

- [\<ScriptDeskCrew>](#scriptdeskcrew)
- [useScriptDeskCrew()](#usescriptdeskcrew)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://scripts.nuxt.com/#website","@type":"WebSite","description":"Nuxt Scripts lets you load third-party scripts with better performance, privacy, security and DX. It includes many popular third-parties out of the box.","name":"Nuxt Scripts","url":"https://scripts.nuxt.com/","publisher":{"@id":"https://scripts.nuxt.com/#identity"}},{"@id":"https://scripts.nuxt.com/scripts/deskcrew#webpage","@type":"WebPage","description":"Add a lazy-loaded DeskCrew support widget to your Nuxt app.","name":"DeskCrew","url":"https://scripts.nuxt.com/scripts/deskcrew","breadcrumb":{"@id":"https://scripts.nuxt.com/scripts/deskcrew#breadcrumb"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/scripts/deskcrew"]}],"primaryImageOfPage":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/#identity","@type":"Organization","name":"Nuxt Scripts","url":"https://scripts.nuxt.com","logo":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/scripts/deskcrew#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Nuxt Scripts","item":"https://scripts.nuxt.com/","position":1},{"@type":"ListItem","name":"Scripts","item":"https://scripts.nuxt.com/scripts","position":2},{"@type":"ListItem","name":"DeskCrew","item":"https://scripts.nuxt.com/scripts/deskcrew","position":3}]},{"@id":"https://scripts.nuxt.com/#logo","@type":"ImageObject","caption":"Nuxt Scripts","contentUrl":"https://scripts.nuxt.com/logo.svg","inLanguage":"en","url":"https://scripts.nuxt.com/logo.svg"}]}
```

## Sitemap

See the full [sitemap](https://scripts.nuxt.com/sitemap.md) for all pages.
