Skip to content

Commit

Permalink
docs: updated example markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Jun 24, 2024
1 parent 14a89d7 commit 2ffee8e
Showing 1 changed file with 0 additions and 60 deletions.
60 changes: 0 additions & 60 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,66 +268,6 @@ console.log(application.name);

## Vonage JWT Package

### MissingPrivateKeyError Class

`MissingPrivateKeyError`
class for throwing an error when the private key
is missing. The private key must either be the string of the key or a buffer
from the key file. When you created the application, the private key would
have been downloaded then. If you lost the key, you will need to regenrate
the key.


#### tokenGenerate

Generates a JWT token.

Generate a JWT token with default claims.


```js
const privateKey = fs.readFileSync(__dirname + '/private.key');
const token = tokenGenerate(applicationId, privateKey);
```




Generate a JWT token with custom claims.


```js
const privateKey = fs.readFileSync(__dirname + '/private.key');
const token = tokenGenerate(applicationId, privateKey, {
subject: 'my-subject',
acl: {
paths: {
'/*/users/**': {},
'/*/conversations/**': {},
'/*/sessions/**': {},
},
},
});
```

#### verifySignature

Verifies a JWT token

Validate a JWT token


```js
const privateKey = fs.readFileSync('./private.key');
if (verifySignature(token, privateKey)) {
console.log('JWT signature verified.');
} else {
console.log('JWT signature verification failed.');
}
```

## Vonage JWT Package

### NumberInsights Class

Client for the Vonage Number Insights API.
Expand Down

0 comments on commit 2ffee8e

Please sign in to comment.