# Reference > Extensions > Fake data

# `fake-data` - Use realistic fake data

This plugin allows you to use realistic fake data in your Artillery tests easily, by giving you access to most functions in the [falso](https://ngneat.github.io/falso/docs/getting-started) library.

* Please check the `falso` documentation for available functions;
* The functions will be available to use as `$<functionName>` in your YAML (e.g. `$randColor()`) script;
* Alternatively, they are also available within `beforeRequest` and `beforeScenario` hooks (e.g. `context.vars.color = $randColor()`);
* You can customise the function's behaviour by passing a configuration object to the plugin (equal to the argument of the function).

### Known limitations

> **Warning:** **Experimental**
>
> This plugin is under active development. We aim to keep it stable, but it may need to introduce breaking changes. Please open an [issue](https://github.com/artilleryio/artillery/issues/new/choose) or [discussion](https://github.com/artilleryio/artillery/discussions/new/choose) for any feedback.

> **Info:** This plugin is only compatible with the `http` engine.
> This plugin is not compatible with `before`/`after` hooks.

* Only `falso` functions that accept one argument (object) are supported;
* If using the function in a hook, you still need to pass the configuration object through the plugin configuration.
* If using the function in a hook, you will only be able to use with `beforeRequest`, `afterResponse` and `function`.

## Usage

### Basic Usage

First, enable the plugin in your Artillery config file.

```yaml
config:
  plugins:
    fake-data: {}
```

Then, the functions will be available to use in your YAML script.

```yaml
scenarios:
  - name: 'Test with fake data'
    flow:
      - post:
          url: '/user'
          json:
            name: '{{ $randFullName() }}'
            email: '{{ $randEmail() }}'
            password: '{{ $randPassword() }}'
```

### Configuring specific functions

You can pass a configuration object to the plugin to customize the behavior of the specific functions. For example:

```yaml
config:
  plugins:
    fake-data:
      randPassword:
        size: 5
```

The above config will make the `$randPassword()` function generate passwords with 5 characters.

### Usage with hooks

You can also use the functions in javascript hooks. They will be available under `context.funcs`. For example:

```js
function myBeforeRequestHook(req, context, ee, next) {
  context.vars.password = context.funcs.$randPassword();
  next();
}
```

Please note that:

* The function will only be available in the `beforeRequest`, `afterResponse` and `function` hooks.
* You still need to pass the configuration object through the plugin configuration.
