PocketID

index.html

  <div class="pocket"></div>
  <script src="https://cdn.pocketid.app/consumer.js"></script>

app.js (frontend)

  Pocket.init({
    providers: ['email','password','google'],
    // the default is https://pocketid.app
    //url: 'http://localhost:7258'
  });

  function onSuccess(token) {
    console.log("Successful login:");
    console.log(token);
    window.alert("You're logged in now.");
  }

  document.querySelector("button").addEventListener("click", function (ev) {
    ev.stopPropagation();
    ev.preventDefault();

    Pocket.token().then(onSuccess).catch(function (e) {
      console.error("No token");
      console.error(e);
      Pocket.signin(onSuccess);
    });

  });

server.js (backend)

app.use('/api/pocket', PocketID.express())