Skip to content

Commit

Permalink
update README with mininal usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandrpravosudko-okta committed Apr 29, 2021
1 parent 6ba8dc2 commit f19c7ee
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,17 @@ none | No digital signature or MAC value included
The following features are not yet supported by this library:

* Encrypting the JWT (aka JWE)

## TypeScript usage

This package includes TypeScript definitions for library interface. They can be used as follows:

```typescript
import { Jwt, create } from 'njwt';

const signingKey: Buffer = crypto.randomBytes(256); // Create a highly random byte array of 256 bytes
const claims = {
iss: 'http://myapp.com/', // The URL of your service
};
const jwt: Jwt = create(claims, signingKey);
```

0 comments on commit f19c7ee

Please sign in to comment.