use-gsi
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

useGSI

Introduction

A tiny React hook that simplifies the process of using the Google Identity Service in a React application

Install

npm

npm install use-gsi

yarn

yarn add use-gsi

Quick Start

Auto initilized google button

Get your Google API client ID

import React from "react";
import { useGSI } from "use-gsi";

export default function App() {
  const [data, setData] = useState({});

  const { buttonRef } = useGSI({
    initializeConfig: {
      //Google API client ID
      client_id: clientId,
      callback: (response) => setData(response),
    },
    method: "renderButton",
    buttonConfig: {
      theme: "outline",
      type: "standard",
    },
  });

  console.log(data);

  return <div ref={buttonRef} />;
}

Options

// TODO

License

The MIT License.

Readme

Keywords

none

Package Sidebar

Install

npm i use-gsi

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

15.4 kB

Total Files

11

Last publish

Collaborators

  • grebenshchikov