@falconeta/capacitor-aws-amplify
plugin that handle amplify features
Install
npm install @falconeta/capacitor-aws-amplify
npx cap sync
android config
Inside MainActivity
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
.
.
.
if (data == null){
Amplify.Auth.handleWebUISignInResponse(null);
}
}
Inside gradle
// Amplify core dependency
implementation 'com.amplifyframework:core:1.38.7'
// AWS Cognito dependency
implementation 'com.amplifyframework:aws-auth-cognito:1.38.7'
API
load(...)
load(options: { cognitoConfig: AWSCognitoConfig; }) => Promise<void>
signIn(...)
signIn(options: { email: string; password: string; }) => Promise<CognitoAuthSession>
Param | Type |
---|
options | { email: string; password: string; } |
Returns: Promise<CognitoAuthSession>
federatedSignIn(...)
federatedSignIn(options: { provider: CognitoHostedUIIdentityProvider; }) => Promise<CognitoAuthSession>
Returns: Promise<CognitoAuthSession>
fetchAuthSession()
fetchAuthSession() => Promise<CognitoAuthSession>
Returns: Promise<CognitoAuthSession>
getUserAttributes()
getUserAttributes() => Promise<{ status: AwsAmplifyPluginResponseStatus; userAttributes: Record<string, string>; }>
Returns: Promise<{ status: AwsAmplifyPluginResponseStatus; userAttributes: Record<string, string>; }>
updateUserAttributes(...)
updateUserAttributes(options: { attributes: { name: AuthUserAttributeKey | string; value: string; }[]; }) => Promise<{ status: AwsAmplifyPluginResponseStatus; userAttributes: Record<string, string>; }>
Param | Type |
---|
options | { attributes: { name: string; value: string; }[]; } |
Returns: Promise<{ status: AwsAmplifyPluginResponseStatus; userAttributes: Record<string, string>; }>
signOut()
signOut() => Promise<{ status: AwsAmplifyPluginResponseStatus; }>
Returns: Promise<{ status: AwsAmplifyPluginResponseStatus; }>
deleteUser()
deleteUser() => Promise<{ status: AwsAmplifyPluginResponseStatus; }>
Returns: Promise<{ status: AwsAmplifyPluginResponseStatus; }>
Interfaces
AWSCognitoConfig
Prop | Type |
---|
aws_cognito_region | string |
aws_user_pools_id | string |
aws_user_pools_web_client_id | string |
aws_cognito_identity_pool_id | string |
aws_mandatory_sign_in | string |
oauth | { domain: string; scope: string[]; redirectSignIn: string; redirectSignOut: string; responseType: 'code'; } |
CognitoAuthSession
Type Aliases
Record
Construct a type with a set of properties K of type T
{
[P in K]: T;
}
Enums
AwsAmplifyPluginResponseStatus
Members | Value |
---|
Ok | 0 |
Ko | -1 |
Cancelled | -2 |
SignedOut | -3 |
CognitoHostedUIIdentityProvider
Members | Value |
---|
Cognito | 'COGNITO' |
Google | 'Google' |
Facebook | 'Facebook' |
Amazon | 'LoginWithAmazon' |
Apple | 'SignInWithApple' |
AuthUserAttributeKey
Members | Value |
---|
address | 'address' |
birthDate | 'birthDate' |
email | 'email' |
familyName | 'familyName' |
gender | 'gender' |
givenName | 'givenName' |
locale | 'locale' |
middleName | 'middleName' |
name | 'name' |
nickname | 'nickname' |
phoneNumber | 'phoneNumber' |
picture | 'picture' |
preferredUsername | 'preferredUsername' |