> For the complete documentation index, see [llms.txt](https://ardzz.gitbook.io/wavel/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ardzz.gitbook.io/wavel/quick-start.md).

# Quick Start

### Installing Open WA

Use this command to install the library for the first time and to keep the library up to date.

```bash
npm i --save @open-wa/wa-automate@latest
```

### Argument list

| Argument      | Description                                                                                                                                                                                                           |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| -p, --port    | Set the port for the api. Default to 8002                                                                                                                                                                             |
| --api-host    | <p>The easy API may be sitting behind a reverse proxy. In this case set<br>--api-host in order to make sure the api docs and api explorer are working<br>properly. You will need to include the protocol as well.</p> |
| -w, --webhook | Webhook to use for the listeners.                                                                                                                                                                                     |
| -k, --key     | <p>Specify an api key to use as a check for all requests. If you add -k by<br>itself, a key will be auto generated for you.</p>                                                                                       |

For more detail each argument use this command

```bash
npx @open-wa/wa-automate --help
```

### Running on a server

If you're not running this on your localhost, you'll need to set the server hostname for the api-docs to work correctly.

```bash
npx @open-wa/wa-automate -p 8080 --api-host 'https://my-wa-api.dev:8080'
```

The environment should be

```
WAVEL_HOST=https://my-wa-api.dev:8080
```

Example usage for standalone should be

```php
$wavel = new Ardzz\Wavel\WavelFactory(
    wavelHost: 'https://my-wa-api.dev:8080'
);
```

### Webhook client

You can also set a webhook address to send all requests

```bash
npx @open-wa/wa-automate -w 'https://my.laravel.project/wavel_webhook_server'
```

### Use webhook and securing server

In order to protect the API server, you must set the API key

```bash
npx @open-wa/wa-automate -p 8080 -k 'S3Cr3T_K3y' --api-host 'https://my-wa-api.dev:8080' 
```

The environment should be

```
WAVEL_HOST=https://my-wa-api.dev:8080
WAVEL_API_KEY=S3Cr3T_K3y
```

Example usage for standalone should be

```php
$wavel = new Ardzz\Wavel\WavelFactory(
    wavelHost: 'https://my-wa-api.dev:8080',
    wavelApiKey: 'S3Cr3T_K3y'
);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ardzz.gitbook.io/wavel/quick-start.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
