-
Notifications
You must be signed in to change notification settings - Fork 62
Configuration
.env is the main configuration
there is an example .env.development
and .env.development
SERVER_ADDRESS=0.0.0.0
SERVER_PORT=3000
SERVER_ADDRESS 0.0.0.0
will listen all address, and exposed to network, you can use 127.0.0.1
to listen only for localhost, and use reverse proxy, so you can add HTTPS
HTTP_BASE_URL=/api/v1/whatsapp
this is where you can access the API
combined it will be like this
http://0.0.0.0:3000/api/v1/whatsapp
# OR
http://YOUR_SERVER_IP:3000/api/v1/whatsapp
# OR
http://127.0.0.1:3000/api/v1/whatsapp
If it to long, use base like this
HTTP_BASE_URL=/wa
If you want to access API using Ajax Javascript, then you need to activate CORS, this can be accessed from many domain
HTTP_CORS_ORIGIN=*
Access it from only your domain
HTTP_CORS_ORIGIN=yourdomain.com
# -----------------------------------
# Authentication Configuration
# -----------------------------------
AUTH_BASIC_USERNAME=admin
AUTH_BASIC_PASSWORD=83e4060e-78e1-4fe5-9977-aeeccd46a2b8
AUTH_JWT_SECRET=9e4eb4cf-be25-4a29-bba3-fefb5a30f6ab
AUTH_JWT_EXPIRED_HOUR=24
For unexpired token, if you use it for Internal API to WA API, change 24 to 0, so the token will never expired.
is not recommended for public API
AUTH_JWT_EXPIRED_HOUR=0
# -----------------------------------
# WhatsApp Configuration
# -----------------------------------
WHATSAPP_DATASTORE_TYPE=sqlite
WHATSAPP_DATASTORE_URI=file:dbs/WhatsApp.db?_foreign_keys=on
WHATSAPP_ONE_MESSAGE_FLIGHT=true
WHATSAPP_MEDIA_IMAGE_CONVERT_WEBP=true
This is the version of Web Whatsapp
You can find this at Settings -> Help
Change it to latest when Go Rest API not Working
WHATSAPP_VERSION_MAJOR=2
WHATSAPP_VERSION_MINOR=2216
WHATSAPP_VERSION_PATCH=6