plebpay-utils
Version:
Utility package for PlebPay.
43 lines (31 loc) • 1.07 kB
Markdown
# plebpay-utils (beta)
[](https://www.npmjs.com/package/plebpay-utils)
Utility package to help protect your site with a PlebPay paywall. Example usage https://github.com/SamSamskies/protected-by-plebpay-example.
If you've never heard of PlebPay, go check it out https://www.plebpay.com/ 😀
## Installation
npm
```
$ npm install plebpay-utils
```
or
yarn
```
$ yarn add plebpay-utils
```
## Usage
Script Tag (no installation required)
```js
<script src="https://unpkg.com/plebpay-utils@1.0.21/dist/index.js" type="text/javascript"></script>
<script>
// replace with your own PlebPay paywall URL
const plebPayPaywallUrl = 'https://www.plebpay.com/c5bc98ff-a386-45ba-9b99-c3b16da9cdaf'
window.PlebPay.redirectIfNecessary(plebPayPaywallUrl)
</script>
```
Module
```js
import { redirectIfNecessary } from 'plebpay-utils'
// replace with your own PlebPay paywall URL
const plebPayPaywallUrl = 'https://www.plebpay.com/c5bc98ff-a386-45ba-9b99-c3b16da9cdaf'
redirectIfNecessary(plebPayPaywallUrl)
```