# k2token

> This package create secure token

Latest version **2.1.0** (published 2022-08-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install k2token
pnpm add k2token
yarn add k2token
bun add k2token
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2022-08-17 |
| First published | 2022-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Kasra Karami |
| Maintainers | kasra.karami.kk |
| Keywords | k2token, jwt, secure, token, jesonwebtoken |

## Links

- npm: https://www.npmjs.com/package/k2token
- Repository: https://github.com/KasraK2K/k2token
- npm.io page: https://npm.io/package/k2token

## Alternatives

- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 2.1.0 (latest) — 2022-08-17
- 1.0.2 — 2022-08-17
- 1.0.1 — 2022-08-15
- 1.0.0 — 2022-04-10

## README

# K2Token


Create more secure token
<br />
<br />

## Create Token:
```typescript
import { sign, IConfigs } from "k2token";

const payload: Record<string, any> = { key: "value" };
const configs: IConfigs = {
  secret: "secret",
  phrase_one: "secret_phrase_one_string",
  phrase_two: "secret_phrase_two_string",
};

const token = sign(payload, configs);
```
<br />


## Verify Token and get Payload:
```typescript
import { verify, IConfigs } from "k2token";

const token = "some_string_token";
const configs: IConfigs = {
  secret: "secret",
  phrase_one: "secret_phrase_one_string",
  phrase_two: "secret_phrase_two_string",
};

const payload: Record<string, any> = verify(payload, configs);
```

---
_Source: https://npm.io/package/k2token · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
