Innovative way to market 📣 and communicate 💬
-
Run
npm install
to install dependencies -
Configure Firebase 🔥
- Make Firebase project
- Go to Authentication and enable Google as sign-in provider
- Enable AppCheck. Check docs for the information how to do it
- Note that some steps on the documentation referenced above apply to frontend
- Go to project settings >> Service accounts >> Firebase Admin sdk >> and download your private key
- Copy the serviceAccountKey.json file to your project
-
Make
.env
file to the root -
Configure all environment variables as in
.env.example
and belowPORT= # Port number FIREBASE_SECRET_KEY_PATH= # File path to Firebase service key. Example: "/config/firebase-admin-secrets/secret-key.json" WHATSAPP_SESSION_PATH= # File path where whatsapp-web.js stores session
-
Run
npm install -g ts-node
to run Suppis in development -
Now you can run
npm run dev
ornpm run start
to start up the app- Note that this not recommended for production
Every request must contain these headers like this 👇
{
"X-Firebase-IdToken": "Your Firebase IdToken here",
"X-Firebase-AppCheck": "Your Firebase AppCheckToken here"
}
Check Firebase docs how to get IdToken and AppCheckToken
- Make user admin on
/admin/set
- Put request
- Takes email in body
"email": <email>
- Responses with string on the body containing message
- Remove admin from user on
/admin/remove
- Delete request
- Takes email in body
"email": <email>
- Responses with string containing message
- Check status of Whatsapp client on
/whatsapp/status
- Any request type
- Responses with string on the body containing message
- On status code 409 responses with object like 👇
{ "type": "qr" "data": "<qr code as text>" }
- Send message to one person on
/whatsapp/send/one
- Post request
- Takes a message and a number in body
- Responses with string on the body containing message
- Send message to list of people on
/whatsapp/send/list
- Post request
- Takes a message and list of numbers in body
- Responses with string on the body containing message