# decentraland-crypto-fetch

> Make requests signed using a Decentraland Identity

Latest version **3.0.0** (published 2026-08-18) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install decentraland-crypto-fetch
pnpm add decentraland-crypto-fetch
yarn add decentraland-crypto-fetch
bun add decentraland-crypto-fetch
```

## Health

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

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-08-18 |
| First published | 2021-11-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=22.0.0 |
| Dependencies | 1 |
| Unpacked size | 26 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Decentraland |
| Maintainers | decentralandbot |
| Keywords | fetch, http, signed, decentraland |

## Links

- npm: https://www.npmjs.com/package/decentraland-crypto-fetch
- Repository: https://github.com/decentraland/core-libs
- npm.io page: https://npm.io/package/decentraland-crypto-fetch

## Dependencies (1)

- [@dcl/crypto](https://npm.io/package/@dcl/crypto.md) 3.7.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2026-08-18
- 2.0.1 — 2023-09-14
- 2.0.0 — 2023-04-10
- 1.0.3 — 2021-12-21
- 1.0.2 — 2021-12-01
- 1.0.1 — 2021-12-01
- 1.0.0 — 2021-11-24

## README

# decentraland-crypto-fetch

Make requests signed using a [Decentraland Identity](https://github.com/decentraland/decentraland-crypto).

Migrated into the `core-libs` monorepo from the legacy [`decentraland-crypto-fetch`](https://github.com/decentraland/decentraland-crypto-fetch) repository.

## Install

```bash
pnpm add decentraland-crypto-fetch
```

Requires Node.js >= 22 (uses global `fetch`, `Headers`, `Request` and `URL`).

## Usage

This library preserves the native [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/fetch) API. You only need an identity generated with [`@dcl/crypto`](https://github.com/decentraland/decentraland-crypto):

```typescript
import fetch from 'decentraland-crypto-fetch'

fetch('https://service.decentraland.org/api/resource', {
  method: 'POST',
  identity
})
```

You can send signed metadata using the `metadata` property:

```typescript
import fetch from 'decentraland-crypto-fetch'

const metadata = { key1: 'value1' }

fetch('https://service.decentraland.org/api/resource', {
  method: 'POST',
  identity,
  metadata
})
```

You can also inject signed headers into an existing request:

```typescript
import fetch from 'decentraland-crypto-fetch'

const metadata = { key1: 'value1' }
const request = new Request('https://service.decentraland.org/api/resource', {
  method: 'POST'
})

fetch(request, { identity, metadata })
```

## Inject implementations

If your environment doesn't have native `fetch`, `Headers`, `Request` or `URL`, or you need to use a specific implementation, create a signed fetch using the factory:

```typescript
import { signedFetchFactory } from 'decentraland-crypto-fetch'
import fetch, { Headers, Request } from 'node-fetch'

const signedFetch = signedFetchFactory({ Headers, Request, fetch })
```

## Server

To build services that accept signed requests, use [`@dcl/crypto-middleware`](../crypto-middleware).

---
_Source: https://npm.io/package/decentraland-crypto-fetch · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
