[英]The difference between AWS Amplify and amazon-cognito-identity-js?
I'm reviewing this demo of how to integrate Cognito with Angular, and it amazon-cognito-identity-js for the authorization service.我正在查看这个关于如何将 Cognito 与 Angular 集成的演示,以及用于授权服务的 amazon-cognito-identity-js 。
It seems that is what we should be using, but other tutorials install AWS Amplify as a whole:这似乎是我们应该使用的,但其他教程将AWS Amplify作为一个整体安装:
npm i aws-amplify
Curious what the difference is and whether one is more current than the other?好奇有什么区别,一个是否比另一个更流行?
amazon-cognito-identity-js
used to be a separate package specifically for Cognito
. amazon-cognito-identity-js
曾经是专门针对Cognito
的单独包。 Recently they've been bundling all their SDKs into Amplify
to streamline the integration process.最近,他们将所有 SDK 捆绑到
Amplify
中以简化集成过程。
For instance in our iOS app the Cognito
SDK had a number of issues that were resolved by moving to Amplify
.例如,在我们的 iOS 应用程序中,
Cognito
SDK 有许多问题已通过迁移到Amplify
得到解决。
As you can see in the link below, this package is now maintained in the Amplify
umbrella.正如您在下面的链接中看到的,这个包现在在
Amplify
伞下维护。
https://github.com/aws-amplify/amplify-js/tree/master/packages/amazon-cognito-identity-js https://github.com/aws-amplify/amplify-js/tree/master/packages/amazon-cognito-identity-js
It used to be standalone here:它曾经在这里是独立的:
https://github.com/amazon-archives/amazon-cognito-identity-js https://github.com/amazon-archives/amazon-cognito-identity-js
I would recommend going forward with Amplify
as that is the direction that AWS development is headed internally, and amazon-cognito-identity-js
is maintained as part of Amplify
anyway.我建议继续使用
Amplify
,因为这是 AWS 内部开发的方向,并且amazon-cognito-identity-js
无论如何都作为Amplify
的一部分进行维护。
To add to the great answer by @DaveS.添加@DaveS 的精彩答案。 There are 3 official tools you can use to integrate Cognito in your app:
您可以使用 3 种官方工具将 Cognito 集成到您的应用程序中:
adminCreateUser
) directly, but there's a workaround .adminCreateUser
),但有一个解决方法。adminCreateUser
.adminCreateUser
。 Code samples for all 3 can be found here: AWS Cognito: Amplify vs amazon-cognito-identity-js vs AWS SDK .可在此处找到所有 3 种代码示例: AWS Cognito:Amplify vs amazon-cognito-identity-js vs AWS SDK 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.