# protect-a-deck

> Protect an MDX deck from invaders 👾

Latest version **0.0.1** (published 2020-02-08) · 0 weekly downloads

## Install

```sh
npm install protect-a-deck
pnpm add protect-a-deck
yarn add protect-a-deck
bun add protect-a-deck
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2020-02-08 |
| First published | 2020-02-08 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ericadamski |

## Links

- npm: https://www.npmjs.com/package/protect-a-deck
- npm.io page: https://npm.io/package/protect-a-deck

## Dependencies (1)

- [unfetch](https://npm.io/package/unfetch.md) ^4.1.0

## Recent versions

- 0.0.1 (latest) — 2020-02-08

## README

# protect-a-deck

Protect an MDX deck from invaders 👾

---

Uses https://paassword.now.sh to safely store your password and then allows a static site to check against it at will.

## Instalation

`yarn add protect-a-deck`

## Usage

See details on how to extend the mdx-deck `Provider` here: https://github.com/jxnblk/mdx-deck/blob/master/docs/advanced.md#custom-provider-component

1. Go to https://paassword.now.sh and get a link that will look like: `https://svrlss.now.sh/api/get/rec3T73O3WNZk3IZj`

2. Copy the last part, the id, of the url. Which would be `rec3T73O3WNZk3IZj` from above.

3. Extend the provider for mdx-deck like the example below passing in your id from step 2.

```JavaScript
// example Provider.js
import React from 'react'
import Protection from 'protect-a-deck'
import { useDeck } from 'mdx-deck'

export default props => {
  const state = useDeck()

  return (
    <Protection paassword="rec3T73O3WNZk3IZj">
      {props.children}
    </Protection>
  )
}
```

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