> For the complete documentation index, see [llms.txt](/llms.txt).

# Static files

You can handle static files in your Snap bundle using the [snap_getFile](/snaps/reference/snaps-api/snap%5Fgetfile/) API method. This is useful to load Wasm modules, ZK circuits, or any other files that must be lazily loaded.

## Steps[​](#steps "Direct link to Steps")

### 1. Specify static files in the Snap's manifest file[​](#1-specify-static-files-in-the-snaps-manifest-file "Direct link to 1. Specify static files in the Snap's manifest file")

Specify static files as an array in the `source.files` field of your Snap's [manifest file](/snaps/learn/about-snaps/files/#manifest-file). File paths are relative to the Snap package root, that is, one level above the `src` directory. For example:

snap.manifest.json

```
"source": {
  "shasum": "xxx",
  "location": {
    // ...
  },
  "files": [
    "./files/myfile.bin"
  ]
}

```

### 2. Load static files using `snap_getFile`[​](#2-load-static-files-using-snap%5Fgetfile "Direct link to 2-load-static-files-using-snap_getfile")

In your Snap code, load static files using [snap_getFile](/snaps/reference/snaps-api/snap%5Fgetfile/). This method returns a string in the encoding specified, with a default of Base64 if no encoding is specified. For example:

index.js

```
const contents = await snap.request({
  method: 'snap_getFile',
  params: {
    path: './files/myfile.bin',
    encoding: 'hex',
  },
})

// "0x..."
console.log(contents)

```

## Example[​](#example "Direct link to Example")

See the [@metamask/get-file-example-snap](https://github.com/MetaMask/snaps/tree/main/packages/examples/packages/get-file)package for a full example of handling static files.
