0.1.0 • Published 4 years ago

react-zeplin-login v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

react-zeplin-login

npm npm bundle size npm

React component for a simple OAuth login with Zeplin.

DEMO HERE

button examples

🚀 Get Started

Follow these steps to start using React Zeplin Login:

  1. Installation

    # with npm
    npm i react-zeplin-login
    
    # with yarn
    yarn add react-zeplin-login
  2. Import and configure component.

    import React from "react";
    import ZeplinLogin from "react-zeplin-login";
    
    export default props => {
      const authHandler = (err, data) => {
        console.log(err, data);
      };
    
      return (
        <ZeplinLogin
          authCallback={authHandler}
          clientId={CLIENT_ID}
          clientSecret={CLIENT_SECRET}
          redirectUri={REDIRECT_URI}
        />
      );
    };
  3. Find more info about keys and OAuth apps in Zeplin official docs

📖 API

PropertyTypeDefaultDescription
authCallbackfunctionrequiredCallback function which takes two arguments (error, authData)
clientIdstringrequiredClient ID of your OAuth App
clientSecretstringrequiredClient Secret of your OAuth App
redirectUristringrequiredAuthorization callback URL of your OAuth App
buttonThemeenum("classic", "light", "light_short", "dark", "dark_short")"classic"Button style theme. Just "classic" is approved by Zeplin team, and de-facto is only one official option
classNamestring""Custom class name

📝 License

MIT