vue-login-broker-library
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

vue-login-broker-library

Use Login Broker (https://login.broker) to login to your app or website with facebook, google, linkedin, microsoft, apple or github. Sign up for free and get 100,000 monthly active users. No credit card required.

Please note that after the user logs in, this will produce a 'sessionId'. This must be verified on your server-side to complete the authentication.

Get a free API key here and also see the details about how to call the api to verify: https://login.broker/account/

Installation

npm install vue-login-broker-library

Usage

  <template>
    <div class="App">
      <LoginBrokerButton platform="google" tenantName="loginbroker" @onSessionReceived="handleSessionReceived" @onErrorReceived="handleErrorReceived" />
      <LoginBrokerButton platform="github" tenantName="loginbroker" @onSessionReceived="handleSessionReceived" @onErrorReceived="handleErrorReceived" />
    </div>
  </template>
  <script lang="ts">
  import { LoginBrokerButton } from 'vue-login-broker-library';
  import 'vue-login-broker-library/dist/style.css';

  export default {
    components: {
      LoginBrokerButton,
    },
    methods: {
      handleSessionReceived(sessionId: any) {
        console.log('Received sessionId', sessionId);
        // Perform further action
        // window.location.href = "https://login.broker/";
      },
      handleErrorReceived(error: any) {
        console.log('Error happened', error);
      },
    },
  };
  </script>

Readme

Keywords

none

Package Sidebar

Install

npm i vue-login-broker-library

Weekly Downloads

0

Version

1.0.0

License

none

Unpacked Size

9.52 kB

Total Files

8

Last publish

Collaborators

  • loginbroker