> For AI agents: the complete documentation index is available at /bull-board/llms.txt, the full documentation bundle is available at /bull-board/llms-full.txt.

# BullAdapter

For the [Bull](https://github.com/OptimalBits/bull) queue library.

## Import

```ts
import { BullAdapter } from '@bull-board/api/bullAdapter';
// or
const { BullAdapter } = require('@bull-board/api/bullAdapter');
```

## Usage

```ts
import { createBullBoard } from '@bull-board/api';
import { BullAdapter } from '@bull-board/api/bullAdapter';
import { ExpressAdapter } from '@bull-board/express';
import Queue from 'bull';

const myQueue = new Queue('my-queue', {
  redis: { host: 'localhost', port: 6379 },
});

const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath('/admin/queues');

createBullBoard({
  queues: [new BullAdapter(myQueue)],
  serverAdapter,
});
```

## Options

All options are optional.

| Option           | Type                              | Default | Description                                                                                                                                                                                    |
| ---------------- | --------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `readOnlyMode`   | `boolean`                         | `false` | Hides all queue and job actions.                                                                                                                                                               |
| `allowRetries`   | `boolean`                         | `true`  | Shows or hides the retry buttons on **failed** jobs. Forced to `false` when `readOnlyMode` is `true`.                                                                                          |
| `description`    | `string`                          | `''`    | Queue description text displayed in the UI.                                                                                                                                                    |
| `displayName`    | `string`                          | `''`    | Overrides the queue name shown in the UI.                                                                                                                                                      |
| `prefix`         | `string`                          | `''`    | Prepended to job names in the UI.                                                                                                                                                              |
| `delimiter`      | `string`                          | `''`    | Delimiter between the prefix and the job name.                                                                                                                                                 |
| `externalJobUrl` | `(job) => { href, displayText? }` | none    | Links each job card to a page in your own app. See [External job URLs](/bull-board/recipes/external-job-url.md).                                                                               |
| `jobDataSchema`  | `object` (JSON Schema)            | none    | Describes the shape of a job's `data`, driving the **Add job** form's prefill, autocomplete and inline validation. See [Job data schema](/bull-board/queue-adapters/index.md#job-data-schema). |

::: tip
`allowCompletedRetries` (available on [`BullMQAdapter`](/bull-board/queue-adapters/bullmq.md)) has no effect here. Bull can't retry completed jobs, so it's always off.
:::

## Instance methods

```ts
adapter.setFormatter('name', (job) => `#${job.name}`);
adapter.setFormatter('data', (data) => redact(data));
adapter.setFormatter('returnValue', (value) => redact(value));
adapter.setFormatter('progress', (progress) => `${Math.round(progress)}%`);

adapter.setVisibilityGuard((request) => {
  // return true to show this queue, false to hide it
  return request.headers['x-tenant-id'] === 'acme';
});
```
