1.0.3 • Published 8 months ago

@meese-os/google-api-provider v1.0.3

Weekly downloads
-
License
BSD-2-Clause
Repository
github
Last release
8 months ago

meeseOS Google API Provider

This is the Google API Provider for meeseOS.

Installation

npm install @meese-os/google-api-provider

In your client bootstrap file (src/client/index.js):

import { GapiServiceProvider } from "@meese-os/google-api-provider";

meeseOS.register(GapiServiceProvider, {
  args: {
    enabled: true,
    src: "https://accounts.google.com/gsi/client",

    // You have to define these
    client: {
      api_key: "",
      client_id: "",
      scope: []
    }
  }
});

Usage

For example in an application:

const meeseOSgapi = core.make("meeseOS/gapi").create();
meeseOSgapi.on("signed-in", () => console.log("You were signed in"));
meeseOSgapi.on("signed-out", () => console.log("You were signed out"));

meeseOSgapi.login().then(gapi => {
  // Do whatever
});

proc.on("destroy", () => meeseOSgapi.destroy());