ngx-login-with-amazon-button
v0.0.2
Published
Angular integration for Login with Amazon SDK
Downloads
56
Maintainers
Readme
NgxLoginWithAmazonButton
Angular integration with the Login With Amazon Web SDK.
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>