---
title: "getNpmPackage"
---

> Documentation Index
> Fetch the complete documentation index at: https://buildrforge.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# getNpmPackage

Path: Forge API › registry

`GET /npm/{package}`

Read an extension's releases as npm's packument for @buildr-custom/<org slug>.<repo slug>.<name>, or the versions of @buildr/sdk that this Forge publishes, for npm to resolve. An org's previous slugs name its packages too. Point the @buildr-custom and @buildr scopes at /npm/ in .npmrc.

## Path parameters

- `package` (`getNpmPackage.path.package`; string, required) — An extension's npm package, @buildr-custom/<org slug>.<repo slug>.<name>, or @buildr/sdk

## Code samples

### cURL

```bash
curl --request GET \
  --url '<base-url>/npm/<package>'
```

### TypeScript

```typescript
const url = '<base-url>/npm/<package>';
const options = {method: 'GET'};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "<base-url>/npm/<package>"

response = requests.get(url)

print(response.text)
```

## Responses

### 200

NpmPackument

#### Example

```json
{}
```

### 400

InvalidRequest

#### Example

```json
{
  "_tag": "InvalidRequest",
  "part": "path",
  "issues": [
    {
      "path": [
        "string"
      ],
      "message": "string"
    }
  ]
}
```

- `_tag` (`getNpmPackage.response.400._tag`; string, required)
  - one of `"InvalidRequest"`
- `part` (`getNpmPackage.response.400.part`; string, required)
  - one of `"path"`, `"query"`, `"headers"`, `"body"`
- `issues` (`getNpmPackage.response.400.issues`; array of object, required)
  - `path` (`getNpmPackage.response.400.issues.path`; array\<any of\>, required)
    - any of the following: `string`, `integer`
  - `message` (`getNpmPackage.response.400.issues.message`; string, required)

### 401

InvalidCredentials

#### Example

```json
{
  "_tag": "InvalidCredentials"
}
```

- `_tag` (`getNpmPackage.response.401._tag`; string, required)
  - one of `"InvalidCredentials"`

### 403

ForbiddenOrigin | RequiresPersonalSession | RunBranchRequired

#### Example

```json
{
  "_tag": "ForbiddenOrigin"
}
```

Any of the following:

- `ForbiddenOriginEncoded`
  - `_tag` (`ForbiddenOriginEncoded._tag`; string, required)
    - one of `"ForbiddenOrigin"`
- `RequiresPersonalSessionEncoded`
  - `_tag` (`RequiresPersonalSessionEncoded._tag`; string, required)
    - one of `"RequiresPersonalSession"`
- `RunBranchRequiredEncoded`
  - `_tag` (`RunBranchRequiredEncoded._tag`; string, required)
    - one of `"RunBranchRequired"`
  - `branch` (`RunBranchRequiredEncoded.branch`; string, required)
    - minLength: `1`
  - `message` (`RunBranchRequiredEncoded.message`; string, required)

### 404

ExtensionNotFound | OrgNotFound

#### Example

```json
{
  "_tag": "ExtensionNotFound",
  "extension_name": "string"
}
```

Any of the following:

- `ExtensionNotFoundEncoded`
  - `_tag` (`ExtensionNotFoundEncoded._tag`; string, required)
    - one of `"ExtensionNotFound"`
  - `extension_name` (`ExtensionNotFoundEncoded.extension_name`; string, required)
    - minLength: `1`
- `OrgNotFoundEncoded`
  - `_tag` (`OrgNotFoundEncoded._tag`; string, required)
    - one of `"OrgNotFound"`

### 429

RateLimited

#### Example

```json
{
  "_tag": "RateLimited"
}
```

- `_tag` (`getNpmPackage.response.429._tag`; string, required)
  - one of `"RateLimited"`

### 500

OrgFailure | ControlPlaneFailure

#### Example

```json
{
  "_tag": "OrgFailure",
  "reason": "string"
}
```

Every option has:

- `reason` (`<option>.reason`; string, required)

Any of the following, each adding:

- `OrgFailureEncoded`
  - `_tag` (`OrgFailureEncoded._tag`; string, required)
    - one of `"OrgFailure"`
- `ControlPlaneFailureEncoded`
  - `_tag` (`ControlPlaneFailureEncoded._tag`; string, required)
    - one of `"ControlPlaneFailure"`

### 503

SessionUnavailable | RateLimitUnavailable

#### Example

```json
{
  "_tag": "SessionUnavailable"
}
```

Any of the following:

- `SessionUnavailableEncoded`
  - `_tag` (`SessionUnavailableEncoded._tag`; string, required)
    - one of `"SessionUnavailable"`
- `RateLimitUnavailableEncoded`
  - `_tag` (`RateLimitUnavailableEncoded._tag`; string, required)
    - one of `"RateLimitUnavailable"`


Source: https://buildrforge.com/docs/api/npm/retrieve/index.md
