ngx-login-with-amazon-button
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

NgxLoginWithAmazonButton

Angular integration with the Login With Amazon Web SDK.

Live Example

Online Documentation

Installation

You need to include @types/login-with-amazon-sdk-browser in devDependencies:

NPM:

npm install -D @types/login-with-amazon-sdk-browser
npm install ngx-login-with-amazon-button

Yarn:

yarn add -D @types/login-with-amazon-sdk-browser
yarn add ngx-login-with-amazon-button

Login with Amazon SDK Installation

Refer to the Login with Amazon documentation.

Usage

You will need a client ID from the Amazon Developer Console. If you don't already have an application registered, please follow the documentation from Amazon.

Include the NgxLoginWithAmazonButtonModule in the imports when declaring an Angular module by calling the static forRoot method with your clientId for the application.

Example:

import { NgModule } from "@angular/core";
import { NgxLoginWithAmazonButtonModule } from "ngx-login-with-amazon-button";
 
@NgModule({
  // ...
  imports: [NgxLoginWithAmazonButtonModule.forRoot("YOUR_CLIENT_ID")]
  // ...
})
export class AppModule {}

You can then include the lwa-button element in your HTML templates. It exposes the authorize event that will occur after successfully authorizing the user, and will respond with a AccessTokenRequest or CodeRequest

Example:

<lwa-button
  src="https://your-button-source"
  (authorize)="handleAuthorize($event)"
>
</lwa-button>

License

MIT

Package Sidebar

Install

npm i ngx-login-with-amazon-button

Weekly Downloads

3

Version

0.0.2

License

MIT

Unpacked Size

154 kB

Total Files

42

Last publish

Collaborators

  • solkaz