You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This app used the Nexmo SMS API to demonstrate how to use build an SMS proxy for masked communication between users.
3
+
This app uses the Nexmo SMS API to demonstrate how to build an SMS proxy for private communication between users. Each user sees only the other party's virtual number, not their real one.
4
4
5
5
## Prerequisites
6
6
7
7
You will need:
8
8
9
9
* A [free Nexmo account](https://dashboard.nexmo.com/sign-up)
10
-
* Somewhere to host this web app, Heroku or Your Local Machine with ngrok both work well
10
+
* Somewhere to host this web app: Heroku or your local machine with ngrok both work well
11
11
12
12
## Installation
13
13
@@ -25,33 +25,34 @@ Rename the config file:
25
25
mv example.env .env
26
26
```
27
27
28
-
Fill in the values in `.env` as appropriate.
28
+
Fill in the values in `.env` as appropriate; this will be your API key and secret, and the Nexmo number you want to use.
29
29
30
-
If preferred you can set previously provisioned numbers in the `PROVISIONED_NUMBERS` configuration value.
30
+
If you do not have a virtual number, you can purchase one via the [dashboard](https://dashboard.nexmo.com).
31
+
32
+
Configure the number's SMS webhook URL to point to your application (if you are using [ngrok](https://ngrok.com) then start your tunnel now), e.g. `https://abcd1234.ngrok.io/webhooks/inbound-sms`
31
33
32
34
### Running the App
33
35
34
36
```sh
35
37
npm start
36
38
```
37
39
38
-
The application should be available on <http://localhost:5000>.
40
+
The application should be available on `http://localhost:3000`.
39
41
40
-
If you have not set up predefined numbers you can access <http://localhost:5000/provision> for the application to provision numbers.
42
+
> To change the port, try `PORT=3001 npm start` as an alternative command
41
43
42
44
### Using the App
43
45
44
-
Register a conversation with the application so that mappings can be created between real user numbers and Nexmo virtual numbers. This is done by making a `POST` such as the following to <http://localhost:5000/conversation>:
46
+
Register a conversation with the application so that mappings can be created between real user numbers and Nexmo virtual numbers. This is done by making a `POST` such as the following to `http://localhost:3000/chat`
47
+
and replacing `USER_A_NUMBER` and `USER_B_NUMBER` with the real numbers of the parties involved:
0 commit comments