Skip to main content

Function: writeUser()

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

Defined in: users.ts:104

Write a user to EventCatalog.

Parameters

ParameterType
catalogDirstring

Returns

Function

Parameters

ParameterType
userUser
options{ override: boolean; }
options.override?boolean

Returns

Promise<void>

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 });