Skip to main content

writeUser

Callable

  • writeUser(catalogDir: string): (user: User, options?: { override?: boolean }) => Promise<void>

  • Write a user to EventCatalog.

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