# prismarine-tokens

> Store and use authentication tokens instead of passwords to prevent Mojang from blocking your account

Latest version **1.0.3** (published 2016-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install prismarine-tokens
pnpm add prismarine-tokens
yarn add prismarine-tokens
bun add prismarine-tokens
```

## Health

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

Positive: no vulnerabilities.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2016-04-24 |
| First published | 2016-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Author | pqml |
| Maintainers | pqml |
| Keywords | minecraft, prismarinejs, mineflayer, bot, nodejs, prismarine, minecraft-protocol |

## Links

- npm: https://www.npmjs.com/package/prismarine-tokens
- Repository: https://github.com/pqml/prismarine-tokens
- Homepage: https://github.com/pqml/prismarine-tokens#readme
- Issues: https://github.com/pqml/prismarine-tokens/issues
- npm.io page: https://npm.io/package/prismarine-tokens

## Dependencies (1)

- [yggdrasil](https://npm.io/package/yggdrasil.md) git+https://github.com/zekesonxx/node-yggdrasil.git

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2016-04-24
- 1.0.2 — 2016-04-24

## README

# prismarine-tokens
Store and use authentication tokens instead of passwords to emulate the way the official launcher works

## Features

* Store all authentications tokens to automatically reuse them on future connections
* Minimal username+password authentications to prevent Mojang from blocking your account
* Support of both mineflayer and minecraft-protocol
* Multiple storage files
* Asynchronous calls
* Easy implementation on your project: just wrap all your bot in a callback function

## Installation

`npm install prismarine-tokens`


## Usage

### Example with mineflayer

```js
var mineflayer = require('mineflayer');
var tokens = require('prismarine-tokens');

var options = {
  host: 'localhost',   // optional
  port: 25565,         // optional
  username: 'email@example.com',
  password: '12345678',
  //Location of the file to store and read tokens for this bot
  //You can use the same file for all your bots
  tokensLocation: './bot_tokens.json',
  //Set to true if you want debug informations
  tokensDebug: true
};

tokens.use(options, function(_err, _opts){

  if (_err) throw _err;

  var bot = mineflayer.createBot(_opts);

  bot.on('connect', function() {
    console.info('connected');
  });

});

```

### Example with minecraft-protocol

```js
var mc = require('minecraft-protocol');
var tokens = require('prismarine-tokens');

var options = {
  host: 'localhost',   // optional
  port: 25565,         // optional
  username: 'email@example.com',
  password: '12345678',
  //Location of the file to store and read tokens for this bot
  //You can use the same file for all your bots
  tokensLocation: './bot_tokens.json',
  //Set to true if you want debug informations
  tokensDebug: true
};


tokens.use(options, function(_err, _opts){

  if (_err) throw _err;

  var client = mc.createClient(_opts);

  client.on('connect', function() {
    console.info('connected');
  });

});

```

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