Skip to content

DEVEXP-1409: README unification#256

Open
Hurus111 wants to merge 6 commits into
mainfrom
chore/readme-unification
Open

DEVEXP-1409: README unification#256
Hurus111 wants to merge 6 commits into
mainfrom
chore/readme-unification

Conversation

@Hurus111

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread README.md
## Prerequisites

Before being able to execute the commands described below, you will need to install Node.js. We recommend [installing the current or the LTS version](https://nodejs.org/en).
- Node.js 18 or later (LTS recommended)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we provide exact list of version used from CI matrix for validation ?
Do we have HTTP link onto each of them ?

Comment thread README.md
## Supported APIs

### Node.js supported versions
| API Category | API Name |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have empty cells onto 1st column when API category is same across rows ? (@marcos-sinch same for Python)

Comment thread README.md
| API Category | API Name |
|-----------------|----------|
| Messaging | [Conversation API](https://developers.sinch.com/docs/conversation) |
| Messaging | [SMS API](https://developers.sinch.com/docs/sms) |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add also here a note about "End Of Sale" for SMS to avoid any new user going to implement SMS usage and not Conversation (@marcos-sinch same for Python)

Comment thread README.md
## SDK usage
`SINCH_CONVERSATION_APP_SECRET` is the app secret set per app in the [Conversation dashboard](https://dashboard.sinch.com/convapi/apps). `parseEvent` works without validating the request, but then its origin can't be verified, so validating is recommended in production.

You can find a complete example in [examples/webhooks](./examples/webhooks).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be pointing to the section related to Conversation:

@Post('/conversation')
public conversation(@Req() request: Request, @Res() res: Response) {
// Initialize the class that will be used to validate the request and parse it
const conversationCallbackWebhook = new ConversationCallbackWebhooks(SINCH_CONVERSATION_APP_SECRET);
// 1 - The first thing to do is to verify the request is legit and has not been tampered with
const validated = conversationCallbackWebhook.validateAuthenticationHeader(request.headers, request['rawBody']);
if (!validated) {
res.status(401).send('Invalid webhook signature');
return;
}
try {
// 2 - Before acting on the request, it must be parsed to verify it's supported and to revive its content
const event = conversationCallbackWebhook.parseEvent(request.body);
// 3 - Once steps 1 and 2 are ok, delegate the event management to the Conversation service
this.conversationEventService.handleEvent(event);
res.status(200).send();
} catch (error) {
console.error(error);
res.status(500).send();
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants