Kevin Suttle
Kevin Suttle

Reputation: 8489

Which AWS JS SDK package(s) to use for Cognito?

As of now, there are at least 5 packages for the AWS SDK as it pertains to Cognito.

Some of them overlap in terms of methods. Many are only slightly different. The docs and links vary from outdated to flat out incorrect.

Most docs are in ES5, some in ES6, some in TypeScript, some in Node.

How are developers supposed to know how to make heads or tails from these?

Upvotes: 3

Views: 367

Answers (1)

John Hanley
John Hanley

Reputation: 81424

I work with Cognito everyday as a developer. I recommend starting with the AWS JavaScript SDK (the full SDK). Everything that you need for Cognito development is there and is always the latest. Once you know the details for Cognito, take a look at the higher level packages. By that time you will probably have written your own library of code and then won't consider the others.

The problem with Cognito development is that unless you stay with the core SDK, the other packages either don't exist or are not compatible with SDKs for other platforms or for other languages such as PHP or Java.

Depending on your goals / requirements, you may need to support mobile, desktop, server, Lambda, etc. If you stay with the core SDK then you can quickly adapt to each environment. If you use a higher level package that only works, for example with node.js, then you have a porting problem.

[EDIT]

One item that I forgot to mention is that Cognito is really three different services and therefore three different sections (classes, etc.) within the SDK. There is Cognito User Pools, Cognito Federated Identities and Cognito Sync. Some of the higher level SDKs only support one or the other or just parts of one to make interfaces easier (or more intuitive).

Upvotes: 5

Related Questions