# Signed Fetch

O `SignedFetch` módulo fornece uma implementação de `fetch` interface que é transparente e compatível com o [signed fetch](https://github.com/decentraland/docs/blob/main/auth/signed_fetch/README.md) protocolo, que define como anexar assinadas [cadeias de autenticação](https://github.com/decentraland/docs/blob/main/auth/authchain/README.md) a requisições de saída.

Os procedimentos para assinar e verificar esta requisição são detalhados na [auth\_chain](https://github.com/decentraland/docs/blob/main/contributor/auth/authchain/README.md) página.

Usando `SignedFetch` a partir de uma cena requer o [`USE_FETCH`](https://github.com/decentraland/docs/blob/main/contributor/content/entity-types/scenes/README.md#permissions) permission.

### Métodos

**`signedFetch`**

Faça uma requisição HTTP como faria com ([`fetch`](https://github.com/decentraland/docs/blob/main/contributor/globals/README.md#http)), adicionando automaticamente os cabeçalhos de verificação.

```ts
interface Request {
  // A URL alvo da requisição:
  url: string;

  // Parâmetros opcionais e autoexplicativos para a requisição:
  init?: {
    method?: string;
    body?: string;
    headers: { [key: string]: string };
  };
}

interface Response {
  // Se a requisição HTTP foi realizada com sucesso (códigos diferentes de 2xx não são falhas)
  ok: boolean;

  // Os detalhes autoexplicativos da resposta:
  status: number;
  statusText: string;
  headers: { [key: string]: string };
  body: string;
}

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