0.7.1 • Published 2 months ago

@unlock-protocol/paywall v0.7.1

Weekly downloads
1
License
MIT
Repository
github
Last release
2 months ago

The paywall

The paywall is an application which can be added to any website to check if a visitor is a member. It also offers the ability to open a "checkout" UI which lets the user purchase a key to any of the locks configured for that page.

Module

A npm module @unlock-protocol/paywall is offered for convenience to export and easily add an Unlock paywall to any site without "hotloading" the code from the unlock servers.

The Paywall Object

The @unlock-protocol/paywall module exports an object called Paywall that may be used to lock a page. It shares 99% of its code with the script you can add to your markup, but rather than instantiating immediately based on a window.unlockProtocolConfig variable, it allows you to control when and how the paywall loads.

Usage is simple:

import { Paywall } from '@unlock-protocol/paywall';

// See https://docs.unlock-protocol.com/getting-started/locking-page#configure-the-paywall
const paywallConfig = {};

// Configure networks to use
const networkConfigs = {
  1: {
    readOnlyProvider: 'HTTP PROVIDER',
    locksmithUri: 'https://locksmith.unlock-protocol.com',
    unlockAppUrl: 'https://app.unlock-protocol.com'
  },
  100: {
    // configuration for xdai... etc
  },
  // etc
}

new Paywall(paywallConfig, networkConfigs);
// from this point onward, it behaves exactly as if you had loaded the script in the <head> of your page.
0.7.1

2 months ago

0.6.6

10 months ago

0.6.8

9 months ago

0.6.3

10 months ago

0.6.4

10 months ago

0.6.1

10 months ago

0.4.4

11 months ago

0.3.5

1 year ago

0.4.1

1 year ago

0.3.2

1 year ago

0.4.0

1 year ago

0.4.3

11 months ago

0.3.4

1 year ago

0.5.1

11 months ago

0.4.2

11 months ago

0.3.3

1 year ago

0.3.1

1 year ago

0.2.1

1 year ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.5

2 years ago

0.1.2

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

3 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago