Ghost/ghost/sdk/layer2
Fabien O'Carroll 399219b6ea Members layer0 (#22)
* Created initial layer0 sdk

* Updated layer1 to use layer0

* Updated layer2 to accept and pass blogUrl to layer1

* Updated theme-dropin to pass blogUrl to layer2

* Updated yarn.lock
2018-11-23 15:43:16 +07:00
..
test Created initial layer2 for Members SDK 2018-11-14 08:47:17 +05:30
.eslintrc.js Created initial layer2 for Members SDK 2018-11-14 08:47:17 +05:30
index.js Members layer0 (#22) 2018-11-23 15:43:16 +07:00
LICENSE Created initial layer2 for Members SDK 2018-11-14 08:47:17 +05:30
package.json Updated layer2 to inline with drop in solution 2018-11-14 17:36:26 +05:30
README.md Updated layer2 to inline with drop in solution 2018-11-14 17:36:26 +05:30

Members Layer 2

Install

npm install @tryghost/members-layer2 --save

or

yarn add @tryghost/members-layer2

Usage

<script src="members-layer2.lib.js"></script>
<script>
    // Sets up binding the elements to the login/logout state
    Members.init().then(function ({getToken}) {
        // can getToken etc...
    });
</script>

Or with a module loader

const Members = require('@tryghost/members-layer2');

// Sets up binding the elements to the login/logout state
Members.init().then(function ({getToken}) {
    // can get token etc...
});

fetch('/ghost/api/v2/content/posts/<id>', { credentials: 'same-origin' });

Develop

This is a mono repository, managed with lerna.

Follow the instructions for the top-level repo.

  1. git clone this repo & cd into it as usual
  2. Run yarn to install top-level dependencies.

Run

  • yarn dev

Test

  • yarn lint run just eslint
  • yarn test run lint and tests

Copyright & License

Copyright (c) 2018 Ghost Foundation - Released under the MIT license.