# NATS

Publish to an NATS subject.

## Configuration

| Name          | Type                   | Optional | Secret | Description                                                                                                                          |
| ------------- | ---------------------- | -------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------ |
| urls          | \[]string              | no       | no     | A list of URLs to connect to. If an item of the list contains commas it will be expanded into multiple URLs.                         |
| subject       | expression             | no       | no     | A subject to write to.                                                                                                               |
| headers       | map\[string]expression | yes      | no     | Explicit message headers to add to messages.                                                                                         |
| metadata      | metadata               | yes      | no     | Determine which (if any) metadata values should be added to messages as headers. The value defaults to `map[]`.                      |
| max_in_flight | int                    | yes      | no     | The maximum number of messages to have in flight at a given time. Increase this to improve throughput. The value defaults to `1024`. |
| auth          | auth                   | yes      | no     | Optional configuration of NATS authentication parameters.                                                                            |

### Metadata

| Name             | Type      | Optional | Secret | Description                                                                                 |
| ---------------- | --------- | -------- | ------ | ------------------------------------------------------------------------------------------- |
| include_prefixes | \[]string | yes      | no     | Provide a list of explicit metadata key prefixes to match against.                          |
| include_patterns | \[]string | yes      | no     | Provide a list of explicit metadata key regular expression (re2) patterns to match against. |

### Auth

| Name           | Type   | Optional | Secret | Description                                                                          |
| -------------- | ------ | -------- | ------ | ------------------------------------------------------------------------------------ |
| user_jwt       | string | yes      | no     | An optional plain text user JWT (given along with the corresponding user NKey Seed). |
| user_nkey_seed | string | yes      | no     | An optional plain text user NKey Seed (given along with the corresponding user JWT). |
