Skip to content

Commit

Permalink
docs: add docs updates
Browse files Browse the repository at this point in the history
Signed-off-by: sarthakjdev <[email protected]>
  • Loading branch information
sarthakjdev committed Jun 2, 2024
1 parent 7ce90bf commit 3f67988
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ You can listen to events using the `on` method available on the [client](api-ref
```typescript
// assuming you have already initiated the client,


whatsappClient.on('Ready', async () => {
console.log("Client is ready to receive messages.")
})

whatsappClient.on('Error', async error => {
console.errpr("An error occured.", error)
})

whatsappClient.on('TextMessage', async message => {
await message.reply({
message: new TextMessage({
Expand All @@ -21,6 +30,16 @@ whatsappClient.on('TextMessage', async message => {
})
})

whatsappClient.on('AudioMessage', async message => {
await message.reply({
message: new TextMessage({
text: 'This is a reply.'
})
})
})

// and so on for other message types...

```


Expand Down Expand Up @@ -54,6 +73,9 @@ The SDK supports the following events out of the box to make it easy to handle b

### System Events

- [Client Ready Event](/api-reference/classes/ClientReadyEvent)
- [Client Error Event](/api-reference/classes/ClientErrorEvent)
- [Client Warning Event](/api-reference/classes/ClientWarningEvent)
- [Message Delivered Event](/api-reference/classes/MessageDeliveredEvent)
- [Message Read Event](/api-reference/classes/MessageReadEvent)
- [Message Sent Event](/api-reference/classes/MessageSentEvent)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
---
title: Setting up Node.js Environment
---

## Setting up Node.js Environment

To get started with Wapi.js, you need to have Node.js installed on your machine. If you don't have Node.js installed, you can download it from the official website [here](https://nodejs.org/en/download/).

### Installing Node.js

<Tip>
To check if you already have Node.js installed on your system, open your terminal and run the following command:
```bash
node -v
```
</Tip>

<Tabs>
<Tab title="Windows">
On Windows, it's as simple as installing any other program. Follow the steps below to install Node.js:
<Steps>
<Step title="Download Node.js">
Download the Node.js installer from the official website [here](https://nodejs.org/en/download/).
</Step>
<Step title="Install">
Run the installer and follow the instructions.
</Step>
<Step title="Check Installation">
Once the installation is complete, open your terminal and run the following command to check if Node.js is installed:
```bash
node -v
```
</Step>
</Steps>
</Tab>
<Tab title="MacOS">
On MacOS, youc an install Node.js using `n`, a node version manager:
<Steps>
<Step title="Download and Intall `n">
Install n using the following command:
```bash
curl -L https://bit.ly/n-install | bash
```
</Step>
<Step title="Re-source">
Close and reopen the terminal, or run the following command to apply the changes:
```bash
source ~/.bashrc # or any other shell you are using
```
</Step>
<Step title="Install Node using `n` (LTS mostly)">
Install the desired version of Node.js using nvm
```bash
sudo n lts
```
</Step>
<Step title="Verify Installation">
Verify the installation:
```bash
node -v
```
</Step>
</Steps>
</Tab>
<Tab title="Linux">
On Linux, you can install Node.js using `nvm`, a node version manager:
<Steps>
<Step title="Download and Install `nvm`">
Install nvm using the following command:
```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
```
</Step>
<Step title="Install">
Close and reopen the terminal, or run the following command to apply the changes:
```bash
source ~/.bashrc # or any other shell you are using
```
</Step>
<Step title="Install Node using NVM (LTS mostly)">
Install the desired version of Node.js using nvm
```bash
nvm use --lts
```
</Step>
<Step title="Verify Installation">
Verify the installation:
```bash
node -v
```
</Step>
</Steps>
</Tab>
</Tabs>




11 changes: 11 additions & 0 deletions apps/js.wapikit.com/logo/dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions apps/js.wapikit.com/logo/light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions apps/js.wapikit.com/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"$schema": "https://mintlify.com/schema.json",
"name": "Wapi.js",
"logo": {
"light": "/logo/logo.svg",
"dark": "/logo/logo.svg"
"light": "/logo/light.svg",
"dark": "/logo/dark.svg",
"href": "/"
},
"metadata": {
"title": "Wapi.js",
Expand Down

0 comments on commit 3f67988

Please sign in to comment.