Copy as Markdown[View as Markdown](/docs/sdk/functions/getConsumersOfSchema.md)

***

# Function: getConsumersOfSchema()

> **getConsumersOfSchema**(`directory`): (`path`) => `Promise`<`Service`\[]>

Defined in: messages.ts:143

Returns the consumers of a given schema path.

## Parameters[​](#parameters "Direct link to Parameters")

| Parameter   | Type     |
| ----------- | -------- |
| `directory` | `string` |

## Returns[​](#returns "Direct link to Returns")

`Function`

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Parameter | Type     |
| --------- | -------- |
| `path`    | `string` |

### Returns[​](#returns-1 "Direct link to Returns")

`Promise`<`Service`\[]>

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

```
import utils from '@eventcatalog/utils';

const { getConsumersOfSchema } = utils('/path/to/eventcatalog');

// Returns the consumers of a given schema path
const consumers = await getConsumersOfSchema('events/InventoryAdjusted/schema.json');
```
