@vonage/verify2
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -9,6 +9,2 @@ import { VerifyLocale } from '../enums'; | ||
type SMSWorkFlowRequest = { | ||
app_has: string | ||
} & Omit<SMSWorkflow, 'appHash'> | ||
export type VerificationRequest = { | ||
@@ -18,3 +14,3 @@ brand: string | ||
| EmailWorkflow | ||
| SMSWorkFlowRequest | ||
| (Omit<SMSWorkflow, 'appHash'> & { app_hash: string }) | ||
| SilentAuthWorkflow | ||
@@ -25,2 +21,3 @@ | VoiceWorkflow | ||
> | ||
code?: string | ||
locale?: VerifyLocale | ||
@@ -27,0 +24,0 @@ channel_timeout?: number |
@@ -19,2 +19,3 @@ import { VerifyLocale } from '../enums'; | ||
> | ||
code?: string | ||
locale?: VerifyLocale | ||
@@ -21,0 +22,0 @@ channelTimeout?: number |
{ | ||
"name": "@vonage/verify2", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "Verify API provides a choice of routes for sending a code to a user. You can use this to confirm a user's contact information, as a second factor when authenticating users, or for step-up authentication.", | ||
@@ -29,8 +29,8 @@ "homepage": "https://github.com/vonage/vonage-node-sdk/tree/main/packages/verify2#readme", | ||
"dependencies": { | ||
"@vonage/server-client": "^1.3.0" | ||
"@vonage/server-client": "^1.4.0" | ||
}, | ||
"devDependencies": { | ||
"@vonage/auth": "^1.2.0", | ||
"@vonage/auth": "^1.3.0", | ||
"nock": "^13.3.0" | ||
} | ||
} |
# Vonage Verify SDK for Node.js | ||
 | ||
[](https://codecov.io/gh/Vonage/vonage-server-sdk) | ||
 | ||
[](../../CODE_OF_CONDUCT.md) | ||
[][license] | ||
 [](https://codecov.io/gh/Vonage/vonage-server-sdk)  [](../../CODE_OF_CONDUCT.md) [][license] | ||
<img src="https://developer.nexmo.com/images/logos/vbc-logo.svg" height="48px" alt="Vonage" /> | ||
This is the Vonage Verify (for version 2) SDK for Node.js for use with | ||
[Vonage APIs](https://www.vonage.com/). To use it you will need a Vonage | ||
account. Sign up [for free at vonage.com][signup]. | ||
This is the Vonage Verify (for version 2) SDK for Node.js for use with [Vonage APIs](https://www.vonage.com/). To use it you will need a Vonage account. Sign up [for free at vonage.com][signup]. | ||
For full API documentation refer to | ||
[developer.vonage.com](https://developer.vonage.com/). | ||
For full API documentation refer to [developer.vonage.com](https://developer.vonage.com/). | ||
- [Installation](#installation) | ||
- [Usage](#using-the-vonage-verify-sdk) | ||
- [Usage](#usage) | ||
- [Promises](#promises) | ||
@@ -37,9 +31,5 @@ - [Testing](#testing) | ||
## Using the Vonage Verify v2 SDK | ||
## Usage | ||
The SDK can be used standalone from the main | ||
[Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) if | ||
you only need to use the Messages API. All you need to do is | ||
`require('@vonage/verify')`, and use the returned object to create your own | ||
client. | ||
Unlike the other SDK's this package is not include in the [Vonage Server SDK for Node.js](https://github.com/vonage/vonage-node-sdk) | ||
@@ -51,4 +41,4 @@ ```js | ||
const credentials = new Auth({ | ||
applicationId: APP_ID, | ||
privateKey: PRIAVTE_KEY, | ||
applicationId: APP_ID, | ||
privateKey: PRIAVTE_KEY, | ||
}) | ||
@@ -59,9 +49,7 @@ const options = {} | ||
Where `credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/tree/3.x/readme/packages/auth#options), | ||
and `options` is any option from [`@vonage/server-client`](https://github.com/Vonage/vonage-node-sdk/tree/3.x/readme/packages/server-client#options) | ||
Where `credentials` is any option from [`@vonage/auth`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/auth/README.md#options), and `options` is any option from [`@vonage/server-client`](https://github.com/Vonage/vonage-node-sdk/blob/3.x/packages/server-client/README.md#options) | ||
## Promises | ||
Most methods that interact with the Vonage API uses Promises. You can either | ||
resolve these yourself, or use `await` to wait for a response. | ||
Most methods that interact with the Vonage API uses Promises. You can either resolve these yourself, or use `await` to wait for a response. | ||
@@ -72,5 +60,5 @@ ```js | ||
vonage.verify2 | ||
.checkCode(VERIFY_REQUEST_ID, CODE) | ||
.then((resp) => console.log(resp)) | ||
.catch((err) => console.error(err)) | ||
.checkCode(VERIFY_REQUEST_ID, CODE) | ||
.then((resp) => console.log(resp)) | ||
.catch((err) => console.error(err)) | ||
``` | ||
@@ -77,0 +65,0 @@ |
10267
235
72
Updated@vonage/server-client@^1.4.0