Skip to content

Commit 0260636

Browse files
committed
Big Update:
- ESLint - Improved foldering - New endpoint: Get Chats - New Endpoint: Get Profile Picture
1 parent 2d075c1 commit 0260636

17 files changed

+4021
-503
lines changed

.eslintrc.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true,
5+
jest: true
6+
},
7+
extends: 'standard',
8+
overrides: [
9+
],
10+
parserOptions: {
11+
ecmaVersion: 'latest',
12+
sourceType: 'module'
13+
},
14+
rules: {
15+
}
16+
}

.github/workflows/pull_request.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ jobs:
2020
- name: Install dependencies
2121
run: npm ci
2222
- name: Run tests
23-
run: npm test
23+
run: npm test
24+
timeout-minutes: 1

.github/workflows/push.yml

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
run: npm ci
2222
- name: Run tests
2323
run: npm test
24+
timeout-minutes: 1
2425
docker:
2526
needs: test
2627
runs-on: ubuntu-latest

README.md

+35-31
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
# WhatsApp Web.js REST API Wrapper
1+
# WhatsAppWeb.js REST API Wrapper
22

33
REST API wrapper for the [whatsapp-web.js](https://github.com/pedroslopez/whatsapp-web.js) library, providing an easy-to-use interface to interact with the WhatsApp Web platform. It is designed to be scalable, secure, and easy to integrate with other applications.
44

5-
It came from my lack of knowlege with NodeJS and the need to create OTP authentication flow where I couldn't trust external services.
6-
75
This project is far from perfect: star it, create issues, features or pull requests ❣️
86

97
**NOTE**: I can't guarantee you will not be blocked by using this method, although it has worked for me. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.
108

119
## Table of Contents
1210

13-
[1. Features](#features)
11+
[1. Quick Start with Docker](#quick-start-with-docker)
1412

15-
[2. Quick Start with Docker](#quick-start-with-docker)
13+
[2. Features](#features)
1614

1715
[3. Run Locally](#run-locally)
1816

@@ -28,12 +26,42 @@ This project is far from perfect: star it, create issues, features or pull reque
2826

2927
[9. Star History](#star-history)
3028

29+
## Quick Start with Docker
30+
31+
[![dockeri.co](https://dockerico.blankenship.io/image/chrishubert/whatsapp-web-api)](https://hub.docker.com/r/chrishubert/whatsapp-web-api)
32+
33+
1. Clone the repository:
34+
35+
```bash
36+
git clone https://github.com/chrishubert/whatsapp-web-api.git
37+
cd whatsapp-web-api
38+
```
39+
40+
3. Run the Docker Compose:
41+
42+
```bash
43+
docker-compose pull && docker-compose up
44+
```
45+
4. Visit http://localhost:3000/api/startSession/ABCD
46+
47+
5. Scan the QR on your console using WhatsApp mobile app -> Linked Device -> Link a Device (it may take time to setup the session)
48+
49+
6. Visit http://localhost:3000/api/getContacts/ABCD
50+
51+
7. EXTRA: Look at all the callbacks data in `./session/message_log.txt`
52+
53+
![Quick Start](./assets/basic_start.gif)
54+
3155
## Features
3256

33-
1. Available API endpoints
34-
- API send message
57+
1. Available API actions endpoints
58+
- API send message (string, MessageMedia, MessageMediaFromURL)
3559
- API validate if number is available on WhatsApp
3660
- API get all contacts
61+
- API get all chats
62+
- API get Profile picture
63+
64+
1. Available API authentication endpoints
3765
- API initiate session
3866
- API terminate session
3967
- API terminate inactive sessions
@@ -53,30 +81,6 @@ This project is far from perfect: star it, create issues, features or pull reque
5381

5482
5. On server start, all existing sessions are restored
5583

56-
## Quick Start with Docker
57-
58-
[![dockeri.co](https://dockerico.blankenship.io/image/chrishubert/whatsapp-web-api)](https://hub.docker.com/r/chrishubert/whatsapp-web-api)
59-
60-
1. Clone the repository:
61-
62-
```bash
63-
git clone https://github.com/chrishubert/whatsapp-web-api.git
64-
cd whatsapp-web-api
65-
```
66-
67-
3. Run the Docker Compose:
68-
69-
```bash
70-
docker-compose up
71-
```
72-
4. Visit http://localhost:3000/api/startSession/ABCD
73-
74-
6. Scan the QR with your phone (it may take time to setup the session)
75-
76-
7. Look at the callbacks data in `./session/message_log.txt`
77-
78-
![Quick Start](./assets/basic_start.gif)
79-
8084
## Run Locally
8185

8286
1. Clone the repository:

0 commit comments

Comments
 (0)