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

***

# Function: writeUser()

> **writeUser**(`catalogDir`): (`user`, `options`) => `Promise`<`void`>

Defined in: users.ts:104

Write a user to EventCatalog.

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

| Parameter    | Type     |
| ------------ | -------- |
| `catalogDir` | `string` |

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

`Function`

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

| Parameter           | Type                       |
| ------------------- | -------------------------- |
| `user`              | `User`                     |
| `options`           | { `override`: `boolean`; } |
| `options.override`? | `boolean`                  |

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

`Promise`<`void`>

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

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

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

// Write a user to the catalog
// user would be written to users/eventcatalog-tech-lead
await writeUser({
  id: 'eventcatalog-tech-lead',
  name: 'EventCatalog Tech Lead',
  email: 'test@test.com',
  avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png',
  slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
});

// Write a team to the catalog and override the existing content (if there is any)
await writeUser({
  id: 'eventcatalog-tech-lead',
  name: 'EventCatalog Tech Lead',
  email: 'test@test.com',
  avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png',
  slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
}, { override: true });
```
