> For the complete documentation index, see [llms.txt](https://docs.hatsprotocol.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hatsprotocol.xyz/for-developers/hats-modules/modules-sdk/get-available-modules.md).

# Get Available Modules

The following functions are used in order to get available modules, as exist in the [Modules Registry](/for-developers/hats-modules/building-hats-modules/modules-registry.md).

See the Module type [here](/for-developers/hats-modules/modules-sdk/types.md#module).

### <mark style="color:purple;">getModules</mark>

Get all available modules, optionally use a filter function in order to retrieve only a subset of the modules.

```typescript
const modules = hatsModulesClient.getAllModules();
```

***Arguments***:

```typescript
filter?: (module: Module) => boolean
```

An optional filter function. For each [Module](/for-developers/hats-modules/modules-sdk/types.md#module), should return `true` if the module should be included, `false` otherwise.

***Response***:

```typescript
{ [id: string]: Module }
```

An object that maps between module IDs and the corresponding module objects. A module ID is its implementation address.

### <mark style="color:purple;">getModuleById</mark>

Get a module object by its ID.

```typescript
const module = hatsModulesClient.getModuleById(moduleId);
```

***Arguments***:

```typescript
string
```

Module's ID (implementation address).

***Response***:

<pre class="language-typescript"><code class="lang-typescript"><strong>Module | undefined
</strong></code></pre>

The module that matches the provided ID, or `undefined` in case no matching module was found.

### <mark style="color:purple;">getModuleByImplementation</mark>

Get a module object by its implementation address.

```typescript
const module = hatsModulesClient.getModuleByImplementation(address);
```

***Arguments***:

```typescript
`0x${string}`
```

Module's implementation address.

***Response***:

<pre class="language-typescript"><code class="lang-typescript"><strong>Module | undefined
</strong></code></pre>

The module that matches the provided address, or `undefined` in case no matching module was found.

### <mark style="color:purple;">getModuleByInstance</mark>

Get the module object of an instance.

```typescript
const module = await hatsModulesClient.getModuleByInstance(address);
```

***Arguments***:

```typescript
`0x${string}`
```

Module's instance address.

***Response***:

<pre class="language-typescript"><code class="lang-typescript"><strong>Module | undefined
</strong></code></pre>

The module that matches the provided address, or `undefined` in case no matching module was found.

### <mark style="color:purple;">getModulesByInstances</mark>

Get the module objects of instances.

```typescript
const modules = await hatsModulesClient.getModulesByInstances(addresses);
```

***Arguments***:

```typescript
`0x${string}`[]
```

Addresses of the module instances.

***Response***:

<pre class="language-typescript"><code class="lang-typescript"><strong>(Module | undefined)[]
</strong></code></pre>

The modules matching the provided addresses. For every address that is not an instance of a registry module, the corresponding return value in the array will be `undefined`.
