open-wa logoopen-wa

Generator options

Script the project generator with flags and see what each choice writes into your project.

Generator options

npm init @open-wa@latest asks for a project type, a language, a browser and optional plugins. This page lists each choice and its flag, so you can run the generator without questions in a script or CI. The project builder offers the same choices on this site and previews every generated file.

Project type

ChoiceWhat you get
Easy API (--mode easy-api)An HTTP server with the Neo dashboard and API explorer. npm start runs wa-automate, which finds wa.config.js or wa.config.ts in the folder by itself.
SDK (--mode sdk)A Node.js bot in index.js or index.ts that passes the config to create(). It replies pong to !ping. There's no HTTP server or dashboard.

JavaScript projects use .js files. TypeScript projects (--language ts) use .ts files with tsconfig.json and editor types; Node.js runs them directly, so there's no build step.

Browser

ChoiceFlagWhat happens
Detect at startupautoReuse installed Chrome or a cached browser, and ask what to download if neither exists.
Use installed Chromesystem-chromeUse the Chrome already on the machine. Never download.
Download ChromechromeDownload Chrome for Testing the first time it's needed, then reuse it. Recommended for calls and media.
Download ChromiumchromiumDownload Chromium the first time it's needed. Some audio and video codecs may be missing.

Downloads happen when you first run npm start, not when the project is created. Choose chrome or chromium for an unattended first start, because auto may stop to ask.

Plugins

PluginFlag valueNotes
Jev chat assistantjevAnswers text messages and offers chat actions. Needs MISTRAL_API_KEY and JEV_API_KEY.
VoxtralvoxtralA voice assistant for voice notes, calls or both (--voxtral-mode). Calls need a license with calling.
WebhookswebhookPosts incoming messages to the URL in WEBHOOK_URL.
ChatwootchatwootConnects a Chatwoot inbox. Easy API only.

The generator writes plugin settings into the config file and lists the variables they need in .env.example. Copy it to .env and fill it in. The generated config loads .env when the file exists, and variables already set in your shell take precedence. Plugins download on the first npm start and are cached in the project.

See Jev, Voxtral, Receive webhooks and Chatwoot for what each plugin does once it runs.

Run without questions

Flags skip their questions, and --yes takes the default for anything you didn't pass:

npm init @open-wa@latest my-api -- --mode easy-api --language js --browser chrome --plugins none --yes

A TypeScript SDK voice assistant:

npm init @open-wa@latest voice-bot -- --mode sdk --language ts --browser chrome --plugins voxtral --voxtral-mode both --yes
FlagValues
--modeeasy-api, sdk
--languagejs, ts
--browserauto, system-chrome, chrome, chromium
--pluginsComma-separated jev, voxtral, webhook, chatwoot, or none
--voxtral-modevoice-notes, calls, both
--no-installWrite the files and skip npm install.
--yesUse defaults for any choice you didn't pass.
--helpPrint usage without creating anything.

The defaults are Easy API, JavaScript, browser detection, no plugins, and installing dependencies. Pass . as the folder to generate into the current directory. npx @open-wa/wa-automate init my-bot opens the same generator.

Generated files

FileWhen
package.jsonAlways. Requires Node.js 22.21.1 or newer and depends on @open-wa/wa-automate.
wa.config.js or wa.config.tsAlways. Holds the session ID, browser choice and plugin settings.
index.js or index.tsSDK projects.
tsconfig.jsonTypeScript projects.
.env.exampleWhen the project needs keys, such as WA_API_KEY for Easy API.
.gitignoreAlways. Ignores .env, node_modules, the browser cache and the saved session file.
README.mdAlways.

The generator refuses to overwrite files that already exist. If npm install fails, keep the files, fix the npm error and run npm install in the folder.

The saved login is a file named after the session, such as my-bot.data.json, in the project folder. Treat it and .env as credentials.

Back to the quick start.

Was this helpful?

Your answer includes the page path and docs version.

On this page