npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@richardneililagan/cognito-integration-demo

v1.1.1

Published

Sample snippets for integrating to Amazon Cognito.

Downloads

4

Readme

cognito-integration-demo

A collection of functions that demonstrate how to communicate with Amazon Cognito, meant to be a proof-of-concept (POC) and/or a simple reference.

As part of the POC, this package includes a CLI client that consumes the functions above. The package also comes with a manifest for the Serverless Framework, so you can deploy the functions as a set of HTTPS API endpoints behind an Amazon API Gateway.

The demo snippets are largely adapted versions of the snippets provided by amazon-cognito-identity-js, which this codebase uses.

About

The functions that demonstrate Cognito functionality are all stored in the src/handlers/ folder. Everything else is mostly just to build the CLI and/or Serverless Framework functionality around it.

If you're only interested in checking out how to talk to Cognito from your code, then all you'll need are the files in src/handlers/. They're written in such a way so that the logic in each handler is pretty much self-supporting, with not much dependencies between each other. (Ultimately, this means that the code can be made better in real use-case environments.)


Installation

If you want to try out the CLI for yourself, you can just clone this repository and run npm link to make the CLI tool available on your PATH, or you can install the release package directly from npm:

npm install -g @richardneililagan/cognito-integration-demo

You will need to prepare an Amazon Cognito User Pool yourself.

The package will look for the following environment variables:

  • APP_COGNITO_USERPOOL_ID - The ID of an Amazon Cognito User Pool

  • APP_COGNITO_USERPOOL_CLIENT_ID - The ID of a client authorized to talk with the User Pool above

  • APP_AWS_REGION - The AWS region where your User Pool is.

  • APP_COGNITO_IDENTITYPOOL_ID - (optional) The ID of an Amazon Cognito Identity Pool, configured to accept federation from the User Pool above. Only required if you want to demo authentication against the AWS SDK.

Usage

The CLI is available through the cognito command if installed globally via npm or the codebase is made available using npm link.

cognito

The available CLI options change depending on the CLI state. (E.g. if you're logged in or not.)

Again, the actual logic is found in the src/handlers/ directory. I've done my best to make sure the functions are as autonomous as possible from each other, so that the actual flow across each one is (hopefully) clearer.

Deploying as a Serverless package

The codebase is also written so that it is deployable via the Serverless Framework. See the serverless.yaml file for more details on the routes.

License

MIT


@techlifemusic