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

# Module: ipfs

## Table of contents

### IPFS Functions

* [configureIpfs](utils_ipfs.md#configureipfs)
* [uploadFileToIpfs](utils_ipfs.md#uploadfiletoipfs)
* [uploadMetadataToIpfs](utils_ipfs.md#uploadmetadatatoipfs)

## IPFS Functions

### configureIpfs

▸ **configureIpfs**(`config`): `void`

Configure the IPFS client with API base URL and authentication

#### Parameters

| Name                 | Type     | Description                         |
| :------------------- | :------- | :---------------------------------- |
| `config`             | `Object` | Configuration object                |
| `config.apiBaseUrl?` | `string` | Base URL for the IPFS API endpoints |
| `config.apiKey?`     | `string` | API key for authentication          |

#### Returns

`void`

### uploadFileToIpfs

▸ **uploadFileToIpfs**(`file`): `Promise`\<`string`>

Uploads a file to IPFS and returns the IPFS URL

#### Parameters

| Name   | Type   | Description        |
| :----- | :----- | :----------------- |
| `file` | `File` | The file to upload |

#### Returns

`Promise`\<`string`>

The IPFS URL of the uploaded file

### uploadMetadataToIpfs

▸ **uploadMetadataToIpfs**(`metadata`): `Promise`\<`string`>

Uploads metadata to IPFS and returns the IPFS URL

#### Parameters

| Name       | Type                           | Description            |
| :--------- | :----------------------------- | :--------------------- |
| `metadata` | `Record`\<`string`, `unknown`> | The metadata to upload |

#### Returns

`Promise`\<`string`>

The IPFS URL of the uploaded metadata
