# Signed Fetch

The `SignedFetch` module provides an implementation of the `fetch` interface that is transparently compliant with the [signed fetch](https://github.com/decentraland/docs/blob/main/auth/signed_fetch/README.md) protocol, which defines how to attach signed [authentication chains](https://github.com/decentraland/docs/blob/main/auth/authchain/README.md) to outgoing requests.

The procedures for signing and verifying this request are detailed in the [authentication chain](https://github.com/decentraland/docs/blob/main/contributor/auth/authchain/README.md) page.

Using `SignedFetch` from a scene requires the [`USE_FETCH`](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/scenes/README.md#permissions) permission.

### Methods

**`signedFetch`**

Make an HTTP request as you would with ([`fetch`](https://github.com/decentraland/docs/blob/main/contributor/globals/README.md#http)), automatically adding the verification headers.

```ts
interface Request {
  // The request target URL:
  url: string;

  // Optional, self-explanatory parameters for the request:
  init?: {
    method?: string;
    body?: string;
    headers: { [key: string]: string };
  };
}

interface Response {
  // Whether the HTTP request was performed successfully (codes other than 2xx are not failures)
  ok: boolean;

  // The self-explanatory details of the response:
  status: number;
  statusText: string;
  headers: { [key: string]: string };
  body: string;
}

function signedFetch(Request): Promise<Response>;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.decentraland.org/contributor/scene-runtime/runtime-modules/signed-fetch.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
