# @loopback/model-api-builder

> Types and helpers for packages contributing Model API builders.

Latest version **7.0.16** (published 2026-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @loopback/model-api-builder
pnpm add @loopback/model-api-builder
yarn add @loopback/model-api-builder
bun add @loopback/model-api-builder
```

## Health

**Score 60/100 (C)** — status: active.

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 7.0.16 |
| Published | 2026-08-18 |
| First published | 2020-01-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | 20 \|\| 22 \|\| 24 |
| Dependencies | 1 |
| Unpacked size | 11.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5106 |
| Author | IBM Corp. and LoopBack contributors |
| Maintainers | rfeng, rmg, dhmlau, theprez, frbuceta, marioestradarosa, achrinza |

## Links

- npm: https://www.npmjs.com/package/@loopback/model-api-builder
- Repository: https://github.com/loopbackio/loopback-next
- Homepage: https://github.com/loopbackio/loopback-next#readme
- Issues: https://github.com/loopbackio/loopback-next/issues
- npm.io page: https://npm.io/package/@loopback/model-api-builder

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.8.1

## Recent versions

- 7.0.16 (latest) — 2026-08-18
- 7.0.15 — 2026-07-16
- 7.0.14 — 2026-06-11
- 7.0.13 — 2026-05-12
- 7.0.12 — 2026-04-14
- 7.0.11 — 2026-03-11
- 7.0.10 — 2026-02-10
- 7.0.9 — 2026-01-12
- 7.0.8 — 2025-12-09
- 7.0.7 — 2025-11-11
- 7.0.6 — 2025-10-15
- 7.0.5 — 2025-09-10
- 7.0.4 — 2025-08-11
- 7.0.3 — 2025-07-15
- 7.0.2 — 2025-06-12
- … 78 more at https://npm.io/package/@loopback/model-api-builder/versions

## README

# @loopback/model-api-builder

Types and helpers for packages contributing Model API builders.

## Overview

The `@loopback/model-api-builder` package provides a contract for extensions
that contribute builders for repositories and controllers. Users provide both
the model class and an extension. The extension is then used to build their
repository and controller based on the model class.

## Installation

```sh
npm install --save @loopback/model-api-builder
```

## Basic use

An extension that contributes the repository and controller builders can be made
by implementing `ModelApiBuilder`:

```ts
import {
  asModelApiBuilder,
  ModelApiBuilder,
  ModelApiConfig,
} from '@loopback/model-api-builder';

@injectable(asModelApiBuilder)
export class SampleApiBuilder implements ModelApiBuilder {
  readonly pattern: string = 'Sample';

  build(
    application: ApplicationWithRepositories,
    modelClass: typeof Model & {prototype: Model},
    config: ModelApiConfig,
  ): Promise<void> {
    // define repository setup here
    // ...
    // define controller setup here
    // ...
  }
}
```

## Contributions

- [Guidelines](https://github.com/loopbackio/loopback-next/blob/master/docs/CONTRIBUTING.md)
- [Join the team](https://github.com/loopbackio/loopback-next/issues/110)

## Contributors

See
[all contributors](https://github.com/loopbackio/loopback-next/graphs/contributors).

## License

MIT

---
_Source: https://npm.io/package/@loopback/model-api-builder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
