diff --git a/README.md b/README.md
index 46b2d29..0a1438b 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ Beta Version - This SDK is not stable right now. It is currently in beta version
## 📖 About
-Wapi.go is a JavaScript module, written in TypeScript, designed to interact with the WhatsApp cloud API in a user-friendly manner.
+Wapi.go is a Golang module, written in TypeScript, designed to interact with the WhatsApp cloud API in a user-friendly manner.
## ✨ Features
diff --git a/docs/api-reference/pkg/business.mdx b/docs/api-reference/pkg/business.mdx
index f83db87..9d06bb7 100644
--- a/docs/api-reference/pkg/business.mdx
+++ b/docs/api-reference/pkg/business.mdx
@@ -4,3 +4,381 @@ import "github.com/sarthakjdev/wapi.go/pkg/business"
+
+## type AnalyticsDataPoint
+
+
+
+```go
+type AnalyticsDataPoint struct {
+ Start int `json:"start,omitempty"`
+ End int `json:"end,omitempty"`
+ Sent int `json:"sent,omitempty"`
+ Delivered int `json:"delivered,omitempty"`
+}
+```
+
+
+## type AnalyticsRequestGranularityType
+
+
+
+```go
+type AnalyticsRequestGranularityType string
+```
+
+
+
+```go
+const (
+ AnalyticsRequestGranularityTypeHalfHour AnalyticsRequestGranularityType = "HALF_HOUR"
+ AnalyticsRequestGranularityTypeDay AnalyticsRequestGranularityType = "DAY"
+ AnalyticsRequestGranularityTypeMonth AnalyticsRequestGranularityType = "MONTH"
+)
+```
+
+
+## type BusinessClient
+
+
+
+```go
+type BusinessClient struct {
+ BusinessAccountId string `json:"businessAccountId" validate:"required"`
+ AccessToken string `json:"accessToken" validate:"required"`
+ PhoneNumber *manager.PhoneNumberManager
+ Template *manager.TemplateManager
+ requester *request_client.RequestClient
+}
+```
+
+
+### func NewBusinessClient
+
+```go
+func NewBusinessClient(config *BusinessClientConfig) *BusinessClient
+```
+
+
+
+
+### func \(\*BusinessClient\) ConversationAnalytics
+
+```go
+func (client *BusinessClient) ConversationAnalytics(options ConversationAnalyticsOptions) (*WhatsAppConversationAnalyticsResponse, error)
+```
+
+
+
+
+### func \(\*BusinessClient\) Fetch
+
+```go
+func (client *BusinessClient) Fetch() FetchBusinessAccountResponse
+```
+
+
+
+
+### func \(\*BusinessClient\) FetchAnalytics
+
+```go
+func (client *BusinessClient) FetchAnalytics(options WhatsappBusinessAccountAnalyticsOptions)
+```
+
+
+
+
+### func \(\*BusinessClient\) GetBusinessId
+
+```go
+func (bc *BusinessClient) GetBusinessId() string
+```
+
+
+
+
+### func \(\*BusinessClient\) SetBusinessId
+
+```go
+func (bc *BusinessClient) SetBusinessId(id string)
+```
+
+
+
+
+## type BusinessClientConfig
+
+
+
+```go
+type BusinessClientConfig struct {
+ BusinessAccountId string `json:"businessAccountId" validate:"required"`
+ AccessToken string `json:"accessToken" validate:"required"`
+ Requester *request_client.RequestClient
+}
+```
+
+
+## type ConversationAnalyticsGranularityType
+
+
+
+```go
+type ConversationAnalyticsGranularityType string
+```
+
+
+
+```go
+const (
+ ConversationAnalyticsGranularityTypeHalfHour ConversationAnalyticsGranularityType = "HALF_HOUR"
+ ConversationAnalyticsGranularityTypeDay ConversationAnalyticsGranularityType = "DAILY"
+ ConversationAnalyticsGranularityTypeMonth ConversationAnalyticsGranularityType = "MONTHLY"
+)
+```
+
+
+## type ConversationAnalyticsOptions
+
+
+
+```go
+type ConversationAnalyticsOptions struct {
+ Start time.Time `json:"start" validate:"required"`
+ End time.Time `json:"end" validate:"required"`
+ Granularity ConversationAnalyticsGranularityType `json:"granularity" validate:"required"`
+ PhoneNumbers []string `json:"phone_numbers,omitempty"`
+
+ ConversationCategory []ConversationCategoryType `json:"conversation_category,omitempty"`
+ ConversationTypes []ConversationCategoryType `json:"conversation_types,omitempty"`
+ ConversationDirection []ConversationDirection `json:"conversation_direction,omitempty"`
+ Dimensions []ConversationDimensionType `json:"dimensions,omitempty"`
+}
+```
+
+
+## type ConversationCategoryType
+
+
+
+```go
+type ConversationCategoryType string
+```
+
+
+
+```go
+const (
+ ConversationCategoryTypeAuthentication ConversationCategoryType = "AUTHENTICATION"
+ ConversationCategoryTypeMarketing ConversationCategoryType = "MARKETING"
+ ConversationCategoryTypeService ConversationCategoryType = "SERVICE"
+ ConversationCategoryTypeUtility ConversationCategoryType = "UTILITY"
+)
+```
+
+
+## type ConversationDimensionType
+
+
+
+```go
+type ConversationDimensionType string
+```
+
+
+
+```go
+const (
+ ConversationDimensionTypeConversationCategory ConversationDimensionType = "CONVERSATION_CATEGORY"
+ ConversationDimensionTypeConversationDirection ConversationDimensionType = "CONVERSATION_DIRECTION"
+ ConversationDimensionTypeConversationType ConversationDimensionType = "CONVERSATION_TYPE"
+ ConversationDimensionTypeCountry ConversationDimensionType = "COUNTRY"
+ ConversationDimensionTypePhone ConversationDimensionType = "PHONE"
+)
+```
+
+
+## type ConversationDirection
+
+
+
+```go
+type ConversationDirection string
+```
+
+
+
+```go
+const (
+ ConversationDirectionBusinessInitiated ConversationDirection = "BUSINESS_INITIATED"
+ ConversationDirectionUserInitiated ConversationDirection = "USER_INITIATED"
+)
+```
+
+
+## type ConversationType
+
+
+
+```go
+type ConversationType string
+```
+
+
+
+```go
+const (
+ ConversationTypeFreeEntry ConversationType = "FREE_ENTRY"
+ ConversationTypeFreeTier ConversationType = "FREE_TIER"
+ ConversationTypeRegular ConversationType = "REGULAR"
+)
+```
+
+
+## type FetchBusinessAccountResponse
+
+
+
+```go
+type FetchBusinessAccountResponse struct {
+ Id string `json:"id" validate:"required"`
+ Name string `json:"name" validate:"required"`
+ TimezoneId string `json:"timezone_id" validate:"required"`
+ MessageTemplateNamespace string `json:"message_template_namespace" validate:"required"`
+}
+```
+
+
+## type MessageTemplatePreview
+
+
+
+```go
+type MessageTemplatePreview struct {
+}
+```
+
+
+## type ProductCatalog
+
+
+
+```go
+type ProductCatalog struct {
+}
+```
+
+
+## type WhatsAppBusinessAccountAnalyticsProductType
+
+
+
+```go
+type WhatsAppBusinessAccountAnalyticsProductType int
+```
+
+
+
+```go
+const (
+ WhatsAppBusinessAccountAnalyticsProductTypeNotificationMessages WhatsAppBusinessAccountAnalyticsProductType = 0
+ WhatsAppBusinessAccountAnalyticsProductTypeCustomerSupportMessages WhatsAppBusinessAccountAnalyticsProductType = 2
+)
+```
+
+
+## type WhatsAppConversationAnalyticsEdge
+
+
+
+```go
+type WhatsAppConversationAnalyticsEdge struct {
+ Data []struct {
+ DataPoints []WhatsAppConversationAnalyticsNode `json:"data_points,omitempty"`
+ } `json:"data,omitempty"`
+ Paging internal.WhatsAppBusinessApiPaginationMeta `json:"paging,omitempty"`
+}
+```
+
+
+## type WhatsAppConversationAnalyticsNode
+
+
+
+```go
+type WhatsAppConversationAnalyticsNode struct {
+ Start int `json:"start" validate:"required"`
+ End int `json:"end,omitempty" validate:"required"`
+ Conversation int `json:"conversation,omitempty"`
+ PhoneNumber string `json:"phone_number,omitempty"`
+ Country string `json:"country,omitempty"`
+ ConversationType string `json:"conversation_type,omitempty"`
+ ConversationDirection string `json:"conversation_direction,omitempty"`
+ ConversationCategory string `json:"conversation_category,omitempty"`
+ Cost int `json:"cost,omitempty"`
+}
+```
+
+
+## type WhatsAppConversationAnalyticsResponse
+
+
+
+```go
+type WhatsAppConversationAnalyticsResponse struct {
+ ConversationAnalytics []WhatsAppConversationAnalyticsEdge `json:"conversation_analytics" validate:"required"`
+}
+```
+
+
+## type WhatsappBusinessAccount
+
+
+
+```go
+type WhatsappBusinessAccount struct {
+ BusinessVerificationStatus string `json:"business_verification_status,omitempty"`
+ Country string `json:"country,omitempty"`
+ Currency string `json:"currency,omitempty"`
+ IsTemplateAnalyticsEnabled string `json:"is_enabled_for_insights,omitempty"`
+ MessageTemplateNamespace string `json:"message_template_namespace,omitempty"`
+ Name string `json:"name,omitempty"`
+ OwnershipType string `json:"ownership_type,omitempty"`
+ PrimaryFundingId string `json:"primary_funding_id,omitempty"`
+ PurchaseOrderNumber string `json:"purchase_order_number,omitempty"`
+ TimezoneId string `json:"timezone_id,omitempty"`
+}
+```
+
+
+## type WhatsappBusinessAccountAnalyticsOptions
+
+
+
+```go
+type WhatsappBusinessAccountAnalyticsOptions struct {
+ Start time.Time `json:"start" validate:"required"`
+ End time.Time `json:"end" validate:"required"`
+ Granularity AnalyticsRequestGranularityType `json:"granularity" validate:"required"`
+ PhoneNumbers []string `json:"phone_numbers,omitempty"`
+
+ // * NOT SUPPORTED AS OF NOW
+ // ProductTypes []WhatsAppBusinessAccountAnalyticsProductType `json:"product_types,omitempty"`
+ CountryCodes []string `json:"country_codes,omitempty"`
+}
+```
+
+
+## type WhatsappBusinessAccountAnalyticsResponse
+
+
+
+```go
+type WhatsappBusinessAccountAnalyticsResponse struct {
+ PhoneNumbers []string `json:"phone_numbers,omitempty"`
+ Granularity string `json:"granularity,omitempty"`
+ DataPoints []AnalyticsDataPoint `json:"data_points,omitempty"`
+}
+```
+
diff --git a/docs/api-reference/pkg/client.mdx b/docs/api-reference/pkg/client.mdx
new file mode 100644
index 0000000..2163297
--- /dev/null
+++ b/docs/api-reference/pkg/client.mdx
@@ -0,0 +1,95 @@
+```go
+import "github.com/sarthakjdev/wapi.go/pkg/client"
+```
+
+
+
+
+## type Client
+
+
+
+```go
+type Client struct {
+ Business business.BusinessClient // Business is the business client.
+ Messaging []messaging.MessagingClient // MessagingClient is the messaging client.
+ eventManager *manager.EventManager // eventManager is the event manager.
+ webhook *manager.WebhookManager // webhook is the webhook manager.
+ requester *request_client.RequestClient
+
+ apiAccessToken string
+ businessAccountId string
+}
+```
+
+
+### func New
+
+```go
+func New(config *ClientConfig) *Client
+```
+
+
+
+
+### func \(\*Client\) GetWebhookGetRequestHandler
+
+```go
+func (client *Client) GetWebhookGetRequestHandler() func(c echo.Context) error
+```
+
+GetWebhookGetRequestHandler returns the handler function for handling GET requests to the webhook.
+
+
+### func \(\*Client\) GetWebhookPostRequestHandler
+
+```go
+func (client *Client) GetWebhookPostRequestHandler() func(c echo.Context) error
+```
+
+GetWebhookPostRequestHandler returns the handler function for handling POST requests to the webhook.
+
+
+### func \(\*Client\) Initiate
+
+```go
+func (client *Client) Initiate() bool
+```
+
+InitiateClient initializes the client and starts listening to events from the webhook. It returns true if the client was successfully initiated.
+
+
+### func \(\*Client\) NewMessagingClient
+
+```go
+func (client *Client) NewMessagingClient(phoneNumberId string) *messaging.MessagingClient
+```
+
+
+
+
+### func \(\*Client\) On
+
+```go
+func (client *Client) On(eventType events.EventType, handler func(events.BaseEvent))
+```
+
+OnMessage registers a handler for a specific event type.
+
+
+## type ClientConfig
+
+
+
+```go
+type ClientConfig struct {
+ BusinessAccountId string
+ ApiAccessToken string
+ WebhookSecret string `validate:"required"`
+
+ // these two are not required, because may be user want to use their own server
+ WebhookPath string
+ WebhookServerPort int
+}
+```
+
diff --git a/docs/api-reference/pkg/events.mdx b/docs/api-reference/pkg/events.mdx
index a28415c..5d160b0 100644
--- a/docs/api-reference/pkg/events.mdx
+++ b/docs/api-reference/pkg/events.mdx
@@ -138,11 +138,12 @@ type BaseMediaMessageEvent struct {
```go
type BaseMessageEvent struct {
- requester requestclient.RequestClient
+ requester request_client.RequestClient
MessageId string `json:"message_id"`
Context MessageContext `json:"context"`
Timestamp string `json:"timestamp"`
IsForwarded bool `json:"is_forwarded"`
+ PhoneNumber string `json:"phone_number"`
}
```
@@ -150,7 +151,7 @@ type BaseMessageEvent struct {
### func NewBaseMessageEvent
```go
-func NewBaseMessageEvent(messageId string, timestamp string, from string, isForwarded bool, requester requestclient.RequestClient) BaseMessageEvent
+func NewBaseMessageEvent(phoneNumber string, messageId string, timestamp string, from string, isForwarded bool, requester request_client.RequestClient) BaseMessageEvent
```
@@ -268,7 +269,7 @@ type CustomerIdentityChangedEvent struct {
```go
type CustomerNumberChangedEvent struct {
- BaseMessageEvent `json:",inline"`
+ BaseSystemEvent `json:",inline"`
ChangeDescription string `json:"changeDescription"`
NewWaId string `json:"newWaId"`
OldWaId string `json:"oldWaId"`
diff --git a/docs/api-reference/pkg/messaging.mdx b/docs/api-reference/pkg/messaging.mdx
index b035477..5118254 100644
--- a/docs/api-reference/pkg/messaging.mdx
+++ b/docs/api-reference/pkg/messaging.mdx
@@ -4,100 +4,63 @@ import "github.com/sarthakjdev/wapi.go/pkg/messaging"
-
-## type Client
+
+## type MessagingClient
-Client represents a WhatsApp client.
+MessagingClient represents a WhatsApp client.
```go
-type Client struct {
+type MessagingClient struct {
Media manager.MediaManager
Message manager.MessageManager
- webhook manager.WebhookManager
- phoneNumberId string
- apiAccessToken string
- businessAccountId string
+ PhoneNumberId string
+ ApiAccessToken string
+ BusinessAccountId string
}
```
-
-### func New
+
+### func \(\*MessagingClient\) GetApiAccessToken
```go
-func New(configs ClientConfig) (*Client, error)
+func (client *MessagingClient) GetApiAccessToken() string
```
-NewWapiClient creates a new instance of Client.
-
-### func \(\*Client\) GetPhoneNumberId
-```go
-func (client *Client) GetPhoneNumberId() string
-```
-
-GetPhoneNumberId returns the phone number ID associated with the client.
-
-
-### func \(\*Client\) GetWebhookGetRequestHandler
+
+### func \(\*MessagingClient\) GetBusinessAccountId
```go
-func (client *Client) GetWebhookGetRequestHandler() func(c echo.Context) error
+func (client *MessagingClient) GetBusinessAccountId() string
```
-GetWebhookGetRequestHandler returns the handler function for handling GET requests to the webhook.
-
-
-### func \(\*Client\) GetWebhookPostRequestHandler
-
-```go
-func (client *Client) GetWebhookPostRequestHandler() func(c echo.Context) error
-```
-GetWebhookPostRequestHandler returns the handler function for handling POST requests to the webhook.
-
-### func \(\*Client\) InitiateClient
+
+### func \(\*MessagingClient\) GetPhoneNumberId
```go
-func (client *Client) InitiateClient() bool
+func (client *MessagingClient) GetPhoneNumberId() string
```
-InitiateClient initializes the client and starts listening to events from the webhook. It returns true if the client was successfully initiated.
+GetPhoneNumberId returns the phone number ID associated with the client.
-
-### func \(\*Client\) On
+
+### func \(\*MessagingClient\) SetApiAccessToken
```go
-func (client *Client) On(eventType events.EventType, handler func(events.BaseEvent))
+func (client *MessagingClient) SetApiAccessToken(apiAccessToken string)
```
-OnMessage registers a handler for a specific event type.
-
-### func \(\*Client\) SetPhoneNucmberId
+
+
+### func \(\*MessagingClient\) SetPhoneNumberId
```go
-func (client *Client) SetPhoneNucmberId(phoneNumberId string)
+func (client *MessagingClient) SetPhoneNumberId(phoneNumberId string)
```
SetPhoneNumberId sets the phone number ID for the client.
-
-## type ClientConfig
-
-ClientConfig represents the configuration options for the WhatsApp client.
-
-```go
-type ClientConfig struct {
- PhoneNumberId string `validate:"required"`
- ApiAccessToken string `validate:"required"`
- BusinessAccountId string `validate:"required"`
- WebhookSecret string `validate:"required"`
-
- // these two are not required, because may be user want to use their own server
- WebhookPath string
- WebhookServerPort int
-}
-```
-
diff --git a/docs/assets/configure-webhook/cloudlfare.png b/docs/assets/configure-webhook/cloudlfare.png
new file mode 100644
index 0000000..d302884
Binary files /dev/null and b/docs/assets/configure-webhook/cloudlfare.png differ
diff --git a/docs/guide/building-your-application/analytics.mdx b/docs/guide/building-your-application/analytics.mdx
new file mode 100644
index 0000000..dd33909
--- /dev/null
+++ b/docs/guide/building-your-application/analytics.mdx
@@ -0,0 +1,3 @@
+---
+title: WhatsApp Business Account Analytics
+---
\ No newline at end of file
diff --git a/docs/guide/building-your-application/creating-wapi-client.mdx b/docs/guide/building-your-application/creating-wapi-client.mdx
deleted file mode 100644
index 35002d8..0000000
--- a/docs/guide/building-your-application/creating-wapi-client.mdx
+++ /dev/null
@@ -1,3 +0,0 @@
----
-title: Initiating the Wapi.go SDK
----
diff --git a/docs/guide/building-your-application/managing-business-account.mdx b/docs/guide/building-your-application/managing-business-account.mdx
new file mode 100644
index 0000000..d9ea1ce
--- /dev/null
+++ b/docs/guide/building-your-application/managing-business-account.mdx
@@ -0,0 +1,3 @@
+---
+title: Managing Business Account
+---
\ No newline at end of file
diff --git a/docs/guide/building-your-application/managing-message-templates.mdx b/docs/guide/building-your-application/managing-message-templates.mdx
new file mode 100644
index 0000000..ecfa6a2
--- /dev/null
+++ b/docs/guide/building-your-application/managing-message-templates.mdx
@@ -0,0 +1,3 @@
+---
+title: Manage Message Templates
+---
\ No newline at end of file
diff --git a/docs/guide/building-your-application/managing-phone-numbers.mdx b/docs/guide/building-your-application/managing-phone-numbers.mdx
new file mode 100644
index 0000000..39b86f0
--- /dev/null
+++ b/docs/guide/building-your-application/managing-phone-numbers.mdx
@@ -0,0 +1,3 @@
+---
+title: Managing Phone Numbers
+---
\ No newline at end of file
diff --git a/docs/guide/building-your-application/sdk-architecture.mdx b/docs/guide/building-your-application/sdk-architecture.mdx
index 3b8c6ca..1bdb011 100644
--- a/docs/guide/building-your-application/sdk-architecture.mdx
+++ b/docs/guide/building-your-application/sdk-architecture.mdx
@@ -2,3 +2,72 @@
title: Wapi.go SDK Architecture
---
+
+Wapi.go has a distributed architecture that is designed to incorporate both the Business Management API as wel as the Cloud API porvided by the WhatsApp Business Platform. The architecture is designed to be modular and extensible, allowing developers to easily add new features and functionalities to the SDK. The architecture is divided into the following components:
+
+
+- Main Top level client with webhook server
+- Business Management API client
+- Messaging Client (Cloud API client)
+
+
+
+
+
+## Main Top level client with webhook server
+
+The main top level client is the entry point for the SDK. It is responsible for handling incoming messages from the WhatsApp Business Platform and any other event notification to which you have made your application at the developer platform to subscribed to. In order, to start using the SDK you must have to create a instance of this client with the following code:
+
+```go
+client := wapi.New(&wapi.ClientConfig{
+ ApiAccessToken: "",
+ BusinessAccountId: "",
+ WebhookPath: "/webhook",
+ WebhookSecret: "",
+ WebhookServerPort: 8080,
+})
+
+```
+
+## Buiness Management API client
+
+Now, in order to access the business account specific features such as managing phone numbers, template messages, accessing analytics and updating other entities, you need to access the instance of business client already initiated in the main client. The business client is responsible for handling all the business management API requests. You can access the business client instance by calling the following code:
+
+```go
+
+businessClient := client.Business
+
+// suppose you want to fetch the conversation analytics data points, then the request would look like:
+
+response, err := client.Business.ConversationAnalytics(business.ConversationAnalyticsOptions{
+ Start: time.Now().Add(-time.Hour * 24 * 7 * 30),
+ End: time.Now(),
+ Granularity: business.ConversationAnalyticsGranularityTypeDay,
+})
+
+if err != nil {
+ log.Fatal(err)
+}
+```
+
+## Messaging Client (Cloud API client)
+
+To access the messaging client you need to create a instance of the messaging client by calling the following code:
+
+```go
+messagingClient := client.NewMessagingClient("")
+
+// you can further access the message manager and send messages to the user by calling the send method availabel in the message manager instance.
+
+messagingClient.Message.send("message component here")
+
+
+// you can also manage the media of your phone number using
+
+messageClient.Media.GetMediaUrl("")
+
+```
+
+
+
+The decision behind initiating the business client in advance on the top client instance and not the messaging client because a main client can have multiple messaging clients each for a distinct phone number but not multiple business client.
diff --git a/docs/guide/building-your-application/sending-messages.mdx b/docs/guide/building-your-application/sending-messages.mdx
index d3ed64d..8e049a6 100644
--- a/docs/guide/building-your-application/sending-messages.mdx
+++ b/docs/guide/building-your-application/sending-messages.mdx
@@ -3,16 +3,18 @@ title: Sending Messages
description: Learn how to send messages using the Wapi.go SDK
---
+Check the architecture [guide](/guide/building-your-application/sdk-architecture) once before moving ahead with this send message guide.
+
Wapi.go SDK provides a simple and easy to use classes architecture to send messages. You can send message of following types using the Wapi.go SDK:
## Send a message
-You can send a message to a user using the `send` method available on the [client](api-reference/classes/Client) class message manager. Here is an example of how you can send a message:
+You can send a message to a user using the `send` method available on the messaging client on main client cloud api manager. Here is an example of how you can send a message:
-```typescript
-// assuming you already have initiated the client,
+```go
+// assuming you already have initiated the client
const textMessage = new TextMessage({
text: 'Hello, how are you?'
})
diff --git a/docs/guide/installation-and-preparations/creating-application.mdx b/docs/guide/installation-and-preparations/creating-application.mdx
index afb27b4..414135e 100644
--- a/docs/guide/installation-and-preparations/creating-application.mdx
+++ b/docs/guide/installation-and-preparations/creating-application.mdx
@@ -7,48 +7,17 @@ title: 'Setting up Wapi.go Application Development Environment'
### Chat bot
-The first step to build a Wapi.go based chat bot is to create a new node.js project. You can quickly setup a new project using the utility NPM package provided with the Wapi.go SDK only, run the following command in your terminal to setup the project:
+The first step to build a Wapi.go based chat bot is to create a new project. You can do this by running the following command:
-```bash
-pnpm create-wapi-app my-whatsapp-bot
+```go
+go mod init
+go get github.com/wapichat/wapi.go
```
-Once you run this command, you would be asked a couple of questions like the name of the project and whether you want to use typescript or javascript for this project. Once you answer them, you project will start to setup and once done. You can navigate to the project directory and start building your chat bot.
-
### Other use cases
-
- You are a developer and want to integrate the whatsapp business API with your existing backend.
- You are a solution partner or a tech partner with WhatsApp and want to access the WhatsApp business API to build a solution for your clients.
-To do so, you can install the Wapi.go SDK using the following command:
-
-
-
- ```bash
- pnpm add @wapijs/Wapi.go
- ```
-
-
- ```bash
- yarn add @wapijs/Wapi.go
- ```
-
-
- ```bash
- npm install @wapi/Wapi.go
- ```
-
-
-
-### You may also consider the following best pratices of developing a Node.js Application:
-
-- Setting up a Linter.
-- Setting up a formatter.
-- Setting up proper scripts in package.json.
-- Using a version control system like Git and setting up workflows for Github Actions for sanity build and lint checks.
-- Using consistent naming conventions.
-- Using environment variables for sensitive information.
-
Process to building the application [docs](/guide/building-your-application), for further assistance.
diff --git a/docs/guide/installation-and-preparations/setup-golang.mdx b/docs/guide/installation-and-preparations/setup-golang.mdx
index 146e3f5..452569d 100644
--- a/docs/guide/installation-and-preparations/setup-golang.mdx
+++ b/docs/guide/installation-and-preparations/setup-golang.mdx
@@ -1,97 +1,14 @@
---
-title: Setting up Node.js Environment
+title: Setting up Golang Environment
---
-## Setting up Node.js Environment
-To get started with Wapi.go, 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
-To check if you already have Node.js installed on your system, open your terminal and run the following command:
-```bash
-node -v
-```
+To get started with Wapi.go, you need to have Golang installed on your machine. If you don't have Golang installed, you can download it from the official website [here](https://go.dev/doc/install).
-
-
- On Windows, it's as simple as installing any other program. Follow the steps below to install Node.js:
-
-
- Download the Node.js installer from the official website [here](https://nodejs.org/en/download/).
-
-
- Run the installer and follow the instructions.
-
-
- Once the installation is complete, open your terminal and run the following command to check if Node.js is installed:
- ```bash
- node -v
- ```
-
-
-
-
- On MacOS, youc an install Node.js using `n`, a node version manager:
-
-
- Install n using the following command:
- ```bash
- curl -L https://bit.ly/n-install | bash
- ```
-
-
- Close and reopen the terminal, or run the following command to apply the changes:
- ```bash
- source ~/.bashrc # or any other shell you are using
- ```
-
-
- Install the desired version of Node.js using nvm
- ```bash
- sudo n lts
- ```
-
-
- Verify the installation:
- ```bash
- node -v
- ```
-
-
-
-
- On Linux, you can install Node.js using `nvm`, a node version manager:
-
-
- Install nvm using the following command:
- ```bash
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
- ```
-
-
- Close and reopen the terminal, or run the following command to apply the changes:
- ```bash
- source ~/.bashrc # or any other shell you are using
- ```
-
-
- Install the desired version of Node.js using nvm
- ```bash
- nvm use --lts
- ```
-
-
- Verify the installation:
- ```bash
- node -v
- ```
-
-
-
-
+
diff --git a/docs/guide/introduction.mdx b/docs/guide/introduction.mdx
index 7c91c9c..04c5fb0 100644
--- a/docs/guide/introduction.mdx
+++ b/docs/guide/introduction.mdx
@@ -36,7 +36,7 @@ Wapi.go is a node.js SDK that helps developers to **build whatsapp business API
Send all types of messages using smart abstraction layer of components.
If you use typescript, you will get full typesafe support. Even with Javascript the JsDocs are well documented.
diff --git a/docs/guide/quickstart.mdx b/docs/guide/quickstart.mdx
index b9740cc..cf3a476 100644
--- a/docs/guide/quickstart.mdx
+++ b/docs/guide/quickstart.mdx
@@ -37,43 +37,3 @@ description: 'Welcome to the home of your new documentation'
-
-
-## Initiating a Wapi.go project
-
-### Chat bot
-
-The first step to build a Wapi.go based chat bot is to create a new node.js project. You can quickly setup a new project using the utility NPM package provided with the Wapi.go SDK only, run the following command in your terminal to setup the project:
-
-```bash
-pnpm create-wapi-app my-whatsapp-bot
-```
-
-Once you run this command, you would be asked a couple of questions like the name of the project and whether you want to use typescript or javascript for this project. Once you answer them, you project will start to setup and once done. You can navigate to the project directory and start building your chat bot.
-
-### Other use cases
-
-
-- You are a developer and want to integrate the whatsapp business API with your existing backend.
-- You are a solution partner or a tech partner with WhatsApp and want to access the WhatsApp business API to build a solution for your clients.
-
-To do so, you can install the Wapi.go SDK using the following command:
-
-
-
- ```bash
- pnpm add @wapijs/Wapi.go
- ```
-
-
- ```bash
- yarn add @wapijs/Wapi.go
- ```
-
-
- ```bash
- npm install @wapi/Wapi.go
- ```
-
-
-
diff --git a/docs/guide/wapijs-sdk-scope.mdx b/docs/guide/wapijs-sdk-scope.mdx
index 8868828..968982f 100644
--- a/docs/guide/wapijs-sdk-scope.mdx
+++ b/docs/guide/wapijs-sdk-scope.mdx
@@ -10,8 +10,7 @@ title: Scope of Wapi.go SDK
## Upcoming Features
-- Support for WhatsApp Business Account Management API
- Support for [Interactive Address Message](https://developers.facebook.com/docs/whatsapp/cloud-api/messages/address-messages)
-- Support for WhatsApp Paymnent API
+- Support for WhatsApp Payments API
- Support for WhatsApp Order Mangement
- Support for [Interactive Location Message](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages/location-request-messages)
\ No newline at end of file
diff --git a/docs/guide/whatsapp-api-setup/account-hierarchy.mdx b/docs/guide/whatsapp-api-setup/account-hierarchy.mdx
deleted file mode 100644
index d235ee4..0000000
--- a/docs/guide/whatsapp-api-setup/account-hierarchy.mdx
+++ /dev/null
@@ -1,10 +0,0 @@
----
-title: Whatsapp Business Account Hierarchy
-description: Let's understand the structure of Whatsapp Business Account
----
-
-
-
-1. Meta Business Account
-2. WhatsApp Business Account
-3. WhatsApp Business Account Phone Numbers and WhatsApp Business Account Template Messages
\ No newline at end of file
diff --git a/docs/guide/whatsapp-api-setup/configuring-webhook.mdx b/docs/guide/whatsapp-api-setup/configuring-webhook.mdx
index 039fe7b..65a5ab2 100644
--- a/docs/guide/whatsapp-api-setup/configuring-webhook.mdx
+++ b/docs/guide/whatsapp-api-setup/configuring-webhook.mdx
@@ -10,8 +10,15 @@ To receive messages from your customers, you need to configure a webhook for you
## Configuring Webhook for local development setup
+### Getting a public URL for your local development setup
-### NGROK
+You may sometimes face an error on the whatsapp webhook management dashboard saying that the URL is malicious in case when you are using NGROK, in that case you must go ahead with using cloudflare tunnel.
+
+- [Using NGROK](#ngrok)
+- [Using Cloudflare Tunnel](#cloudflare-tunnel)
+
+
+#### NGROK
If you are developing your application locally, you can use [ngrok](https://ngrok.com/) to expose your local server to the internet.
@@ -28,6 +35,26 @@ ngrok http http://localhost:
+Make sure to replace `` with the port number on which your application is running.
+
+
+#### Cloudflare Tunnel
+
+To use cloudflare tunnel, follow these steps:
+
+1. Download and install cloudflare tunnel from [here](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation).
+2. Run the following command in your terminal to expose your local server to the internet:
+
+```bash
+cloudflared tunnel --url http://localhost:
+```
+
+3. You will see something like this in your terminal:
+
+
+
+
+Make sure to replace `` with the port number on which your application is running.
### Submitting URL to whatsapp business platform
@@ -49,7 +76,7 @@ Follow the steps below to submit your webhook URL to the Whatsapp Business Platf
-
+
Webhook secret is the same string which you have used in your Wapi.go Application Client.
@@ -66,3 +93,4 @@ Follow the steps below to submit your webhook URL to the Whatsapp Business Platf
+
diff --git a/docs/mint.json b/docs/mint.json
index 056f9de..b9ee83a 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -63,36 +63,41 @@
{
"group": "Guide",
"iconType": "regular",
+ "pages": ["guide/introduction", "guide/quickstart"]
+ },
+ {
+ "group": "Installation and Preparations",
+ "pages": [
+ "guide/installation-and-preparations/setup-golang",
+ "guide/installation-and-preparations/creating-application"
+ ]
+ },
+ {
+ "group": "Whatsapp API setup",
+ "pages": [
+ "guide/whatsapp-api-setup/understanding-whatsapp-business-platform",
+ "guide/whatsapp-api-setup/creating-business-app",
+ "guide/whatsapp-api-setup/getting-api-key",
+ "guide/whatsapp-api-setup/configuring-webhook"
+ ]
+ },
+ {
+ "group": "Building your application",
+ "pages": [
+ "guide/building-your-application/sdk-architecture",
+ "guide/building-your-application/managing-business-account",
+ "guide/building-your-application/managing-message-templates",
+ "guide/building-your-application/managing-phone-numbers",
+ "guide/building-your-application/building-message-components",
+ "guide/building-your-application/sending-messages",
+ "guide/building-your-application/event-handling",
+ "guide/building-your-application/replying-and-reacting",
+ "guide/building-your-application/handling-media"
+ ]
+ },
+ {
+ "group": "Others",
"pages": [
- "guide/introduction",
- "guide/quickstart",
- {
- "group": "Installation and Preparations",
- "pages": [
- "guide/installation-and-preparations/setup-node",
- "guide/installation-and-preparations/creating-application"
- ]
- },
- {
- "group": "Whatsapp API setup",
- "pages": [
- "guide/whatsapp-api-setup/understanding-whatsapp-business-platform",
- "guide/whatsapp-api-setup/creating-business-app",
- "guide/whatsapp-api-setup/getting-api-key",
- "guide/whatsapp-api-setup/configuring-webhook"
- ]
- },
- {
- "group": "Building your application",
- "pages": [
- "guide/building-your-application/creating-wapi-client",
- "guide/building-your-application/building-message-components",
- "guide/building-your-application/sending-messages",
- "guide/building-your-application/event-handling",
- "guide/building-your-application/replying-and-reacting",
- "guide/building-your-application/handling-media"
- ]
- },
"guide/wapijs-sdk-scope",
"guide/references",
"guide/contributing",
@@ -105,7 +110,7 @@
"api-reference/pkg/messaging",
"api-reference/pkg/components",
"api-reference/pkg/events",
- "api-reference/pkg/business.mdx"
+ "api-reference/pkg/business"
]
}
],