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

react-module-signin-dynamodb

v1.0.3

Published

A react module that manages the passwordless sign in flow (email otp based), is based on AWS dynamodb as the backend

Downloads

4

Readme

react-module-signin-dynamodb

A react module that manages the passwordless sign in flow (email otp based), is based on AWS dynamodb as the backend

NPM JavaScript Style Guide

Note

This module is under active development. Expect frequent updates.

Overview

This is a module that provides password less sign in functionality that is email and otp based. The backend is based on AWS DynamoDB. This module integrates the following components:

Functionality

After the module is called, the splash screen is loaded first. Splash screen checks the validity of the local login state against the backend login state (in dynamodb). If valid, it returns true. Else it redirects to the sign in screen.

Screens

Splash Screen Component

Sign In Component

Otp Component

Then install the dependencies.

Install

npm install --save react-module-signin-dynamodb

Then install the dependencies.

Dependencies


npm install --save aws-sdk
npm install --save bootstrap
npm install --save react-bootstrap
npm install --save react-dynamodb-helper
npm install --save react-ses-helper
npm install --save react-ui-components-superflows
npm install --save react-email-mask
npm install --save react-safe-storage
npm install --save react-otp-dynamodb
npm install --save react-signin-dynamodb
npm install --save react-splash-dynamodb
npm install --save react-ui-themes-superflows

Then review the AWS configuration.

Configuration

AWS SES Sender Receiver

The sender (source) email address should be configured and verified. If SES is in sandbox mode, the receiver email address(es) should also be configured and verified. A test email should be sent from the SES console and ensured that the intended receiver receives it.

AWS SES Template

This is required if you are planning to send templated emails. An html template should be created. As of July 22, SES console does not support adding email templates. They can only be done through the apis. Best way is to do it via aws command line interface.

AWS DynamoDB

This component uses dynamodb as the backend. Please create a table as follows:

  • Name: Account_Credentials
  • Partition Key: email
  • Sort Key: none

Create a sample record for testing as follows:

  • email: some_valid_email
  • firstName: some_firstname
  • lastName: some_lastname

AWS Credentials

AWS region, secret and access key form the credentials. These are required to use this package. It is crucial that these credentials are given the following permissions:

  • SES email sending permissions
  • Create, Update, Delete, View permissions for the Account_Credentials table in dynamodb

Usage


import React from 'react'
import 'bootstrap/dist/css/bootstrap.min.css';

import { SignInModule } from 'react-module-signin-dynamodb'
import Themes from 'react-ui-themes-superflows';

const App = () => {

  function signInResult(result) {
    console.log('sign in result', result);
  }

  const theme = Themes.getTheme('Default');

  return (
  
    /*

      lsSecret: a string to be used as passphrase for react safe storage
      lsToken: sign in token, to be obtained from react safe storage
      lsEmail: sign in email
      logoMasthead: app logo
      logoAlt: app logo alt info
      awsRegion: aws sdk region
      awsSecret: aws sdk secret
      awsKey: aws sdk access key
      buttonCaptionSignIn: caption of sign in button
      buttonCaptionOtp=: caption of verify button
      emailTemplateOtp: ses template name
      projectName: project name
      emailSource: source email address as configured in SES
      infoOtp: info message prefix on otp screen
      onSubmitResult: call back function for sign in result
      theme: theme (optional)

    */

    <SignInModule
      
      lsSecret="secret_passphrase"  
      lsToken="token"
      lsEmail="email"
      logoMasthead="https://******************naws.com/superflows_black.png"
      logoAlt="Super flows logo"
      awsRegion="aws_region"
      awsSecret="aws_secret"
      awsKey="aws_access_key"
      buttonCaptionSignIn="Sign In"
      buttonCaptionOtp="Verify"
      emailTemplateOtp="TemplateOtp1"
      projectName="SF-21"
      emailSource="supe************@gmail.com"
      infoOtp="One time password (otp) has been sent to "
      onSubmitResult={signInResult}
      theme={theme}

    />

  )
}

export default App

License

MIT © superflows-dev