<commit_before># JWT Manager

[![Build Status](https://travis-ci.org/GeorgeHanson/jwt-manager.svg?branch=master)](https://travis-ci.org/GeorgeHanson/jwt-manager)

JWT Manager is a Javascript Library designed to make storing and retrieving JWT tokens easier. It has an easy to use API
designed to make working with JSON Web Tokens much easier.

## Installation
You can install this package by running `npm install --save jwt-manager`.

You can then import the library using the following:

```js
import {Manager} from 'jwt-manager';
```

## Usage
Using the JWT Manager library you can set, get, forget and refresh JWT Tokens. By default they are stored as a cookie, however you can change this to local storage if you would prefer.
To change the store to local storage, simply use the following:
```js
JWTManager.config.store = 'local';
```

### Setting JWT Tokens
Once you retrieve a valid JWT Token from your server, you can store the JWT token by using the following method call: `JWTManager.setToken('jwt-token')`. This will then store the JWT Token in the storage driver chosen (defaults to cookie).
<commit_msg>Update readme to show instantiation of class<commit_after># JWT Manager

[![Build Status](https://travis-ci.org/GeorgeHanson/jwt-manager.svg?branch=master)](https://travis-ci.org/GeorgeHanson/jwt-manager)

JWT Manager is a Javascript Library designed to make storing and retrieving JWT tokens easier. It has an easy to use API
designed to make working with JSON Web Tokens much easier.

## Installation
You can install this package by running `npm install --save jwt-manager`.

You can then import the library using the following:

```js
import {Manager} from 'jwt-manager';
window.JWTManager = new Manager();
```

## Usage
Using the JWT Manager library you can set, get, forget and refresh JWT Tokens. By default they are stored as a cookie, however you can change this to local storage if you would prefer.
To change the store to local storage, simply use the following:
```js
JWTManager.config.store = 'local';
```

### Setting JWT Tokens
Once you retrieve a valid JWT Token from your server, you can store the JWT token by using the following method call: `JWTManager.setToken('jwt-token')`. This will then store the JWT Token in the storage driver chosen (defaults to cookie).

{'fraction_non_alphanumeric': 0.08311575282854657, 'fraction_numerical': 0.0, 'mean_word_length': 4.6905940594059405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4681492', 'n_tokens_mistral': 647, 'n_tokens_neox': 622, 'n_words': 315}