Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Frum%2Fsdk-installation%2Fjavascript%2Fbundler-plugins%2Fvite.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Frum%2Fsdk-installation%2Fjavascript%2Fbundler-plugins%2Fvite.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# Coralogix Vite Plugin

[![npm version](https://img.shields.io/npm/v/@coralogix/vite-plugin)](https://www.npmjs.com/package/@coralogix/vite-plugin) [![npm dm](https://img.shields.io/npm/dm/@coralogix/vite-plugin)](https://www.npmjs.com/package/@coralogix/vite-plugin) [![npm dt](https://img.shields.io/npm/dt/@coralogix/vite-plugin)](https://www.npmjs.com/package/@coralogix/vite-plugin)

> A Vite plugin that creates metadata asset for support micro frontend in Coralogix.

## Installation[​](#installation "Direct link to Installation")

```
npm i -D @coralogix/vite-plugin
```

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

```
// vite.config.js

import { defineConfig } from 'vite';

import { coralogixVitePlugin } from '@coralogix/vite-plugin';



export default defineConfig({

  plugins: [

    coralogixVitePlugin({

      app: 'test-app',

      version: '1.0.0'

    })

  ]

});
```

## Options[​](#options "Direct link to Options")

| Option      | Type   | Description                                                                                                                             |
| ----------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------- |
| `app`       | string | Name of the micro frontend. Coralogix labels errors from this bundle with it.                                                           |
| `version`   | string | Version of the micro frontend, labelled alongside `app`.                                                                                |
| `outputDir` | string | Optional. Directory to write `cx-metadata.json` into, relative to the build output directory. Defaults to the root of the build output. |

Set `outputDir` when the bundle is served from somewhere other than the root of the output directory, so the RUM SDK finds the metadata next to the assets it describes.
