# @lwc/wire-service

> @wire service

Latest version **9.4.3** (published 2026-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lwc/wire-service
pnpm add @lwc/wire-service
yarn add @lwc/wire-service
bun add @lwc/wire-service
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 9.4.3 |
| Published | 2026-09-02 |
| First published | 2018-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16.6.0 |
| Dependencies | 0 |
| Unpacked size | 26.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1790 |
| Maintainers | lwc-admin, caridy, jye-sf, ravi.jayaramappa, jodarove, abdulsattar, rax-it1, lpomerleau |
| Keywords | lwc |

## Links

- npm: https://www.npmjs.com/package/@lwc/wire-service
- Repository: https://github.com/salesforce/lwc
- Homepage: https://lwc.dev
- Issues: https://github.com/salesforce/lwc/issues
- npm.io page: https://npm.io/package/@lwc/wire-service

## Recent versions

- 9.4.3 (latest) — 2026-09-02
- 9.4.6-alpha.1 (canary) — 2026-09-22
- 9.3.10 (winter27) — 2026-09-21
- 9.1.5 (summer26) — 2026-04-28
- 8.25.1 (spring26) — 2025-11-19
- 8.20.6 (winter26) — 2025-10-20
- 8.16.5 (summer25) — 2025-05-05
- 8.10.3 (spring25) — 2025-01-09
- 7.1.5 (winter25) — 2024-10-10
- 7.0.1-alpha.0 (next) — 2024-06-21
- 6.4.5 (summer24) — 2024-06-05
- 5.0.10 (spring24) — 2024-03-20
- 3.0.4 (winter24) — 2023-10-02
- 2.40.2-lbc (lbc-avante-garde) — 2023-03-21
- 2.31.8 (spring23) — 2023-03-20
- … 876 more at https://npm.io/package/@lwc/wire-service/versions

## README

# Wire Service

This code is the implementation of the Lightning Web Component wire service. The wire service enables declarative binding of data providers called _wire adapters_ to a Lightning web component using the `@wire` decorator. It fulfills the goals of the [data service proposal](https://github.com/salesforce/lwc-rfcs/blob/master/text/0000-data-service.md).

## Summary

Wire adapters simply provide data. A wire adapter doesn't know anything about the components that it provides data to.

In a component, declare its data needs by using the `@wire` decorator to connect (or wire) it to a wire adapter. In this example, the component is wired to the `getBook` wire adapter. This declarative technique makes component code easy to read and reason about.

```js
// bookItem.js
import { LightningElement } from 'lwc';

export default class WireExample extends {
    @api bookId;

    @wire(getBook, { id: '$bookId'})
    book;
}
```

Wire adapters are part of LWC's reactivity system. An `@wire` takes the name of a wire adapter and an optional configuration object, which is specific to the wire adapter. You can use a `$` to mark the property of a configuration object as reactive. When a reactive property’s value changes, the wire adapter's `update` method executes with the new value. When the wire adapter provisions new data, the component rerenders if necessary.

```js
// wire-adapter.js
import { bookEndpoint } from './server';

export class getBook {
    connected = false;
    bookId;

    constructor(dataCallback) {
        this.dataCallback = dataCallback;
    }

    connect() {
        this.connected = true;
        this.provideBookWithId(this.bookId);
    }

    disconnect() {
        this.connected = false;
    }

    update(config) {
        if (this.bookId !== config.id) {
            this.bookId = config.id;
            this.provideBookWithId(this.bookId);
        }
    }

    provideBookWithId(id) {
        if (this.connected && this.bookId !== undefined) {
            const book = bookEndpoint.getById(id);

            if (book) {
                this.dataCallback(Object.assign({}, book));
            } else {
                this.dataCallback(null);
            }
        }
    }
}
```

## Syntax

For complete information about syntax, see [lwc.dev/guide/wire_adapter](https://lwc.dev/guide/wire_adapter#wire-adapters).

## Implementation Example

The RCast App is a PWA podcast player written with Lightning Web Components.

https://github.com/pmdartus/rcast

---
_Source: https://npm.io/package/@lwc/wire-service · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
