Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
83f9f8b
add get contacts by group chat
xyloph0xy May 25, 2024
2563d26
add postman collection
xyloph0xy May 25, 2024
95cd976
add login fitur
xyloph0xy Jun 22, 2024
a35bb08
change package.json add join and get contact api
xyloph0xy Jun 22, 2024
d8a0bfd
customize for production
Jun 28, 2024
3aa814f
remove middleware on image endpoint
teguhwin8 Jul 2, 2024
b6ebf44
create database for authentication
teguhwin8 Jul 2, 2024
ffc65fa
Update README.md
penadigital00 Jul 2, 2024
4b267ca
add feature get All session
xyloph0xy Jul 3, 2024
d5ac41e
Merge branch 'feature/db-user' into feature/getAllSession
xyloph0xy Jul 3, 2024
a354c62
Merge pull request #1 from pendig/feature/getAllSession
xyloph0xy Jul 3, 2024
343dda1
custom puppeter session, tested work
Jul 7, 2024
bf732ab
Merge pull request #2 from pendig/feature/custom-for-prod
penadigital00 Jul 7, 2024
18dc9d1
feat: add custom webhook url
teguhwin8 Jul 10, 2024
f92c6d8
feat: save session into database
teguhwin8 Jul 16, 2024
8953803
update webhook api
teguhwin8 Aug 7, 2024
fa0fb70
feat: add list session api from database
teguhwin8 Aug 18, 2024
cacd0dd
update webhook url on session
teguhwin8 Aug 21, 2024
df4a1ca
Refactor flushSessions to support user-specific session deletion and …
teguhwin8 Aug 23, 2024
11e6c91
fix: session callback
teguhwin8 Aug 24, 2024
182f510
Add Migration and Seeder
penadigital00 Aug 24, 2024
cfcb746
Refactor .env.example, docker-compose, dockerfile, readmie
penadigital00 Aug 24, 2024
86e9b57
fix: set webhook is only for message and media
teguhwin8 Aug 24, 2024
a54a15e
Update README.md disclaimer Docker cannot running
penadigital00 Aug 24, 2024
269733b
fix harcode dataype callback
penadigital00 Aug 25, 2024
989dd5a
Fix Redirect Webhook base on session
penadigital00 Aug 25, 2024
fc4c5f3
resetup session when update webhook url
penadigital00 Aug 25, 2024
fcc86b4
remind webhook url session
penadigital00 Aug 25, 2024
a94e86d
fix: update session webhook url, re-initialize client
teguhwin8 Aug 25, 2024
b2c6de0
sort session by newest
teguhwin8 Aug 30, 2024
f589481
feat: add JWT expiration configuration to environment variables
teguhwin8 Jan 18, 2025
7e79e26
fix: update whatsapp-web.js dependency to specific version
teguhwin8 Jan 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
node_modules

# Ignore dotenv files
.env
#.env
.env.example

# Ignore logs
Expand All @@ -27,4 +27,4 @@ Dockerfile
docker-compose.yml
swagger.yml
.github
assets
assets
34 changes: 25 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
## Application ##
PORT=3000 # OPTIONAL, DEFAULT 3000
API_KEY=your_global_api_key_here # OPTIONAL, DEFAULT EMPTY
BASE_WEBHOOK_URL=http://localhost:3000/localCallbackExample # MANDATORY
PORT=3000
#OPTIONAL, DEFAULT 3000
API_KEY=
#API_KEY=your_global_api_key_here # OPTIONAL, DEFAULT EMPTY
BASE_WEBHOOK_URL=http://localhost:3000/localCallbackExample

ENABLE_LOCAL_CALLBACK_EXAMPLE=TRUE # OPTIONAL, DISABLE FOR PRODUCTION
RATE_LIMIT_MAX=1000 # OPTIONAL, THE MAXIUM NUMBER OF CONNECTIONS TO ALLOW PER TIME FRAME
RATE_LIMIT_WINDOW_MS=1000 # OPTIONAL, TIME FRAME FOR WHICH REQUESTS ARE CHECKED IN MS
RATE_LIMIT_MAX=5000 # OPTIONAL, THE MAXIUM NUMBER OF CONNECTIONS TO ALLOW PER TIME FRAME
RATE_LIMIT_WINDOW_MS=5000 # OPTIONAL, TIME FRAME FOR WHICH REQUESTS ARE CHECKED IN MS

## Client ##
MAX_ATTACHMENT_SIZE=10000000 # IF REACHED, MEDIA ATTACHMENT BODY WILL BE NULL
SET_MESSAGES_AS_SEEN=TRUE # WILL MARK THE MESSAGES AS READ AUTOMATICALLY
# ALL CALLBACKS: auth_failure|authenticated|call|change_state|disconnected|group_join|group_leave|group_update|loading_screen|media_uploaded|message|message_ack|message_create|message_reaction|message_revoke_everyone|qr|ready|contact_changed|media
# ALL CALLBACKS: auth_failure|authenticated|call|change_state|disconnected|group_join|group_leave|group_update|loading_screen|media_uploaded|message|message_ack|message_create|message_reaction|message_>
DISABLED_CALLBACKS=message_ack|message_reaction # PREVENT SENDING CERTAIN TYPES OF CALLBACKS BACK TO THE WEBHOOK
WEB_VERSION='2.2328.5' # OPTIONAL, THE VERSION OF WHATSAPP WEB TO USE
WEB_VERSION_CACHE_TYPE=none # OPTIONAL, DETERMINTES WHERE TO GET THE WHATSAPP WEB VERSION(local, remote or none), DEFAULT 'none'

# - WEB_VERSION have expired base on this reference
# https://wppconnect.io/whatsapp-versions/
# 'https://raw.githubusercontent.com/wppconnect-team/wa-version/main/html/' + webVersion + '.html'
# https://github.com/wppconnect-team/wa-version/tree/main/html
WEB_VERSION='2.3000.1015466705-alpha'
WEB_VERSION_CACHE_TYPE=remote
#none # OPTIONAL, DETERMINTES WHERE TO GET THE WHATSAPP WEB VERSION(local, remote or none), DEFAULT 'none'

RECOVER_SESSIONS=TRUE # OPTIONAL, SHOULD WE RECOVER THE SESSION IN CASE OF PAGE FAILURES

## Session File Storage ##
SESSIONS_PATH=./sessions # OPTIONAL

ENABLE_SWAGGER_ENDPOINT=TRUE # OPTIONAL
ENABLE_SWAGGER_ENDPOINT=TRUE # OPTIONAL
ACCESS_TOKEN_SECRET=Ajnxiuw9k20NJIoniw

DATABASE_URL=postgresql://username:password@localhost:5432/mydb # REQUIRED
#Example: postgresql://username:password@localhost:5432/mydb

JWT_EXPIRED=24h
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,18 @@ RUN set -x \
&& apk add --no-cache \
udev \
ttf-freefont \
chromium
chromium \
git

COPY .env ./

# Copy package.json and package-lock.json to the working directory
COPY package*.json ./

# Install the dependencies
RUN npm ci --only=production --ignore-scripts
#RUN npm ci --only=production --ignore-scripts
#RUN npm install
RUN npm install --only=production

# Copy the rest of the source code to the working directory
COPY . .
Expand All @@ -29,4 +34,4 @@ COPY . .
EXPOSE 3000

# Start the API
CMD ["npm", "start"]
CMD ["npm", "start", "run"]
Loading