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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@giveindia/loginmodule

v2.2.3

Published

Development Package for "Login Functionalities" required for Give's Internal and External facing applications. Developed In React.js

Readme

GiveIndia Development Components

Login Component for Fundraisers

Usage

Installation

  npm i @giveindia/loginmodule
  import LoginModule from '@giveindia/loginmodule'

  // for server side rendered apps, this may result in conflict at compilation. In which case, you could use

  const LoginModule = React.lazy(() => import('@giveindia/loginmodule'))

Standard Usage

  <LoginModule 
    open={true}         
    facebookAppID="required for Facebook Login"
    googleClientID="required for Google Login"        
    OTPLength={4} //Defaults to 4, if nothing provided
    baseURL={`https://yourbase.domain`}  // Defaults to https://staging.letzchange.org
    telCountryCode={'IN'} // Would be value from config.defaults.country_code
    preAuthorize={false}  // Default to false. Select true if you with to show the existing logged in user and allow action to conitnue.
    title="Almost there!" // Defaults to Login. Customized title for the Login Application
    subtitle="Verify yourself"  // Default to <empty_string>. Customized subtitle for the Login Application
    preAuthorize={false}  // Default to false. Select true if you with to show the existing logged in user and allow action to conitnue.
  />

Advanced Usage

To Prefill data on the LoginModule or to show options that user can choose to verify, you can pass an attribute idenfier with values as follows

Option 1: Pre-fill Single Data (Email or Mobile)

  <LoginModule 
    open={true}         
    facebookAppID="required for Facebook Login"
    googleClientID="required for Google Login"        
    OTPLength={4} //Defaults to 4, if nothing provided
    baseURL={`https://yourbase.domain`}  // Defaults to https://staging.letzchange.org
    telCountryCode={'IN'} // Would be value from config.defaults.country_code 
    idenfier={{      
      identifier: 'mobile',
      value: '+918989898989'
    }}   
  />

This would render directly the OTP Entering screen with the value set as what was passed to the Component as shown below

Option 2: Pre-fill Multiple Data (Email and Mobile) allowing user to select

  <LoginModule 
    open={true}         
    facebookAppID="required for Facebook Login"
    googleClientID="required for Google Login"        
    OTPLength={4} //Defaults to 4, if nothing provided
    baseURL={`https://yourbase.domain`}  // Defaults to https://staging.letzchange.org
    telCountryCode={'IN'} // Would be value from config.defaults.country_code 
    idenfier={[
      {
        identifier: 'mobile',
        value: '+918989898989'
      },
      {
        identifier: 'email', 
        value: '[email protected]'
      }
    ]}
  />

This would allow user to select either their Mobile or Phone Input and proceed with Login with the selected data.

Attributes

Additional Implementation Guide(s)

Note* For Server side rendered apps, using React.lazy(), you'd have to use Suspense with a fallback to render it at client-side.


import React, { Suspense } from 'react'

<Suspense fallback={<div>Loading...</div>}>
  <LoginModule ... />
</Supsense>

UI Customisation

The Login Component fits in to the width assigned by the the container. For a standard usage, keep the width of the box between 400px to 500px.

Custom Hooks

Hooks that can be used for checking login and failure

  <LoginModule 
    open={true}    
    OTPLength={4} //Defaults to 4, if nothing provided
    onSuccess={onLoginSuccess}
    onFailure={onLoginFailure}
    baseURL="..."  // Defaults to https://staging.letzchange.org
    telCountryCode={'IN'} // Would be value from config.defaults.country_code
  />

You can define a function within your code to check for success or failure during Login.

  const onLoginSuccess = (response) => {
    ...
  }

  // Response from the Component will look like 
  {
    token: '.....',
    user: {
      name: '.....',
      email: '......',
      is_admin: false,
      profile_pic: '....',
      ....
    }
  }

  const onLoginFailure = (response) => {
    ....    
  }

  // Response on failure should will look like
  {
    error: "Error message here",
  }

Configure Additional Information on the Modal

Configurable title, subtitle, supportId, tncLink, privacyLink attributes

 <LoginModule
    title="Almost there!" // Defaults to Login. Customized title for the Login Application
    subtitle="Verify yourself"  // Default to <empty_string>. Customized subtitle for the Login Application
    supportId={supportId} // Pass the support email id (Ex: support@domainName)
    tncLink={tncLink} // Pass the Valid URL redirecting to Terms and conditions page (Ex: https://domainName/terms-conditions)
    privacyLink={privacyLink} // Pass the Valid URL redirecting to Privacy page (Ex: https://domainName/privacy)
    
  />