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-browsernpm install ngx-login-with-amazon-button
Yarn:
yarn add -D @types/login-with-amazon-sdk-browseryarn 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:
;;
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: