Skip to content

Commit

Permalink
chore: removed UI package, add docs for cloudflare tunnel usage for l…
Browse files Browse the repository at this point in the history
…ocal development and other minor doc fixes (#36)
  • Loading branch information
sarthakjdev authored Jun 28, 2024
1 parent 0371dd4 commit 3b0903c
Show file tree
Hide file tree
Showing 30 changed files with 220 additions and 801 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ to .

## I Have a Question

> If you want to ask a question, we assume that you have read the available [Documentation](https://wapijs.co).
> If you want to ask a question, we assume that you have read the available [Documentation](https://javascript.wapikit.com).
Before you ask a question, it is best to search for existing [Issues](https://github.com/sarthakjdev/wapi.js/issues) that might help you. In case you have found a suitable issue and still need clarification, you can write your question in this issue. It is also advisable to search the internet for answers first.

Expand Down Expand Up @@ -79,7 +79,7 @@ Depending on how large the project is, you may want to outsource the questioning
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible.

- Make sure that you are using the latest version.
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://wapijs.co). If you are looking for support, you might want to check [this section](#i-have-a-question)).
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (Make sure that you have read the [documentation](https://javascript.wapikit.com). If you are looking for support, you might want to check [this section](#i-have-a-question)).
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in the [bug tracker](https://github.com/sarthakjdev/wapi.js/issues?q=label%3Abug).
- Also make sure to search the internet (including Stack Overflow) to see if users outside of the GitHub community have discussed the issue.
- Collect information about the bug:
Expand Down Expand Up @@ -121,7 +121,7 @@ This section guides you through submitting an enhancement suggestion for Wapi.js
#### Before Submitting an Enhancement

- Make sure that you are using the latest version.
- Read the [documentation](https://wapijs.co) carefully and find out if the functionality is already covered, maybe by an individual configuration.
- Read the [documentation](https://javascript.wapikit.com) carefully and find out if the functionality is already covered, maybe by an individual configuration.
- Perform a [search](https://github.com/sarthakjdev/wapi.js/issues) to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
- Find out whether your idea fits with the scope and aims of the project. It's up to you to make a strong case to convince the project's developers of the merits of this feature. Keep in mind that we want features that will be useful to the majority of our users and not just a small subset. If you're just targeting a minority of users, consider writing an add-on/plugin library.

Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<div align="center">
<br />
<p align="center">
<a href="https://wapijs.co"><img src="https://media.discordapp.net/attachments/1046394448088674371/1247281980111061054/wapijs_banner.png?ex=6662c11d&is=66616f9d&hm=d930fdb0c01a9651a9197c9226209ac1ab2dfdf099b4faf198613b13aaf88721&=&format=webp&quality=lossless&width=2261&height=1034" alt="@wapijs/wapi.js" /></a>
<a href="https://javascript.wapikit.com"><img src="https://mintlify.s3-us-west-1.amazonaws.com/na-730c8179/assets/banner.svg" alt="@wapijs/wapi.js" /></a>
</p>
<br />
<p>
<a href="/"><img src="https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white" /></a>
<a href="https://www.npmjs.com/package/@whatsappjs/Wapi.js"><img src="https://img.shields.io/badge/NPM-%23000000.svg?style=for-the-badge&logo=npm&logoColor=white" /></a>
<a href="https://www.npmjs.com/package/@wapijs/wapi.js"><img src="https://img.shields.io/badge/NPM-%23000000.svg?style=for-the-badge&logo=npm&logoColor=white" /></a>
<a href=""><img src="https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white" /></a>
</p>
</div>

Visit the documentation of the SDK [here](https://javascript.wapikit.com)

## 📌 Status

Beta Version - This SDK is not stable right now. It is currently in beta version. Report issues [here](https://github.com/sarthakjdev/wapi.js/issues).
Expand Down Expand Up @@ -61,11 +63,6 @@ pnpm create-wapi-app

- **Notification Payloads**: Details can be found [here](https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks/components).

## 🔗 Other Links

- [Website](https://wapijs.co)
- [Documentation](https://wapijs.co/docs)

## Example Usage

```typescript
Expand Down Expand Up @@ -116,7 +113,7 @@ For detailed guidelines, check [Contributing.md](./CONTRIBUTING.md).

## 📜 License

Distributed under the Apache 2.0 License. View [LICENSE](./LICENSE).
Distributed under the AGPL 3.0 License. View [LICENSE](./LICENSE).

## 📞 Contact

Expand Down
Binary file added apps/docs/assets/configure-webhook/cloudlfare.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 30 additions & 3 deletions apps/docs/guide/whatsapp-api-setup/configuring-webhook.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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
<Note>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.</Note>

- [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.

Expand All @@ -28,6 +35,26 @@ ngrok http http://localhost:<your-application-port>
<img src="/assets/configure-webhook/1.png" />
</Frame>

<Note>Make sure to replace `<your-application-port>` with the port number on which your application is running.</Note>


#### 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:<your-application-port>
```

3. You will see something like this in your terminal:
<Frame>
<img src="/assets/configure-webhook/cloudlfare.png" />
</Frame>

<Note>Make sure to replace `<your-application-port>` with the port number on which your application is running.</Note>


### Submitting URL to whatsapp business platform
Expand All @@ -49,8 +76,8 @@ Follow the steps below to submit your webhook URL to the Whatsapp Business Platf
</Accordion>
</Step>
<Step>
<Accordion title="Add the NGROK public URL and webhook secret.">
<Note>Webhook secret is the same string which you have used in your Wapi.js Application Client.</Note>
<Accordion title="Add the public URL and webhook secret.">
<Note>Webhook secret is the same string which you have used in your Wapi.go Application Client.</Note>

<Frame>
<img src="/assets/configure-webhook/3.png" />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"authors": [
"sarthak@softlancer.co"
],
"license": "Apache-2.0",
"license": "AGPL-3.0",
"repository": {
"type": "git",
"url": "git+https://github.com/sarthakjdev/wapi.js.git"
Expand Down
2 changes: 1 addition & 1 deletion packages/create-wapi-app/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div align="center">
<br />
<p align="center">
<a href="https://wapijs.co"><img src="https://www.wapijs.co/assets/logo/logo-light.svg" alt="@wapijs/wapi.js" height="200" width="360" /></a>
<a href="https://javascript.wapikit.com"><img src="https://www.javascript.wapikit.com/assets/logo/logo-light.svg" alt="@wapijs/wapi.js" height="200" width="360" /></a>
</p>
<br />
<p>
Expand Down
4 changes: 2 additions & 2 deletions packages/create-wapi-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"chat-bot",
"whatsapp-bot"
],
"homepage": "https://www.wapijs.co",
"license": "Apache-2.0",
"homepage": "https://javascript.wapikit.com",
"license": "AGPL-3.0",
"dependencies": {
"chalk": "^5.3.0",
"commander": "^12.0.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/create-wapi-app/src/create-bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ export async function createWhatsappBot(options: {
if (bun) {
await cp(
new URL(
`../template/Bun/${
isTypescriptEnabled ? "typescript" : "javascript"
`../template/Bun/${isTypescriptEnabled ? "typescript" : "javascript"
}/package.json`,
import.meta.url,
),
Expand Down Expand Up @@ -139,7 +138,7 @@ export async function createWhatsappBot(options: {
console.log();
console.log(
chalk.green(
`Setup done!! You can visit the documentation here https://wapijs.co, to smoothly build your bot.`,
`Setup done!! You can visit the documentation here https://javascript.wapikit.com, to smoothly build your bot.`,
),
);
}
4 changes: 2 additions & 2 deletions packages/example-chat-bot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function init() {
'Getting Started': [
{
question: 'How do I get started with wapi.js?',
answer: 'Check out the docs at https://wapijs.co/docs and use the "create-wapi-app" template.'
answer: 'Check out the docs at https://javascript.wapikit.com/ and use the "create-wapi-app" template.'
},
{
question: 'Is wapi.js easy to learn?',
Expand All @@ -48,7 +48,7 @@ function init() {
'Help & Support': [
{
question: 'Is wapi.js free and open-source?',
answer: "Yes, it's completely free and open-source under the Apache 2.0 License."
answer: "Yes, it's completely free and open-source under the AGPL 3.0 License."
},
{
question: 'Where can I get help or support for wapi.js?',
Expand Down
8 changes: 0 additions & 8 deletions packages/ui/.eslintignore

This file was deleted.

4 changes: 0 additions & 4 deletions packages/ui/.eslintrc.js

This file was deleted.

43 changes: 0 additions & 43 deletions packages/ui/package.json

This file was deleted.

1 change: 0 additions & 1 deletion packages/ui/prettier.config.js

This file was deleted.

129 changes: 0 additions & 129 deletions packages/ui/src/button.tsx

This file was deleted.

Loading

0 comments on commit 3b0903c

Please sign in to comment.