Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

React component for a simple OAuth login with Crowdin

License

Notifications You must be signed in to change notification settings

crowdin/react-crowdin-login

Repository files navigation

React Crowdin Login

npm npm npm bundle size GitHub issues

React component for a simple OAuth login with Crowdin.

DEMO HERE

light border lowerc short light border lowerc dark border lowerc short dark border lowerc

Get Started

Follow these steps to start using React Crowdin Login:

  1. Installation
# with npm
npm i @crowdin/react-crowdin-login

# with yarn
yarn add @crowdin/react-crowdin-login
  1. Import and configure component.
import React from "react";
import CrowdinLogin from "@crowdin/react-crowdin-login";

export default props => {
  const authHandler = (err, data) => {
    console.log(err, data);
  };

  return (
    <CrowdinLogin
      authCallback={authHandler}
      clientId={CLIENT_ID}
      clientSecret={CLIENT_SECRET}
      redirectUri={REDIRECT_URI}
      scope={SCOPE}
    />
  );
};
  1. Find more info about keys and OAuth apps in official docs ― Creating an OAuth App

API

Property Type Default Description
authCallback function required Callback function which takes two arguments (error, authData)
clientId string required Client ID of your OAuth App
clientSecret string required Client Secret of your OAuth App
redirectUri string required Authorization callback URL of your OAuth App
scope string required Scope that will be requested. Understanding Scopes for OAuth Apps
buttonTheme enum: "light", "light_short", "dark", "dark_short" "light" Button style theme, that based on Login Branding Guidelines
className string "" Custom class name

Contribution

We are happy to accept contributions to the React Crowdin Login. To contribute please do the following:

  1. Fork the repository on GitHub.
  2. Decide which code you want to submit. Commit your changes and push to the new branch.
  3. Ensure that your code adheres to standard conventions, as used in the rest of the library.
  4. Submit a pull request with your patch on Github.

Seeking Assistance

If you find any problems or would like to suggest a feature, please feel free to file an issue on Github at Issues Page.

Need help working with React Crowdin Login or have any questions? Contact Customer Success Service.

Author

License

The React Crowdin Login is licensed under the MIT License.
See the LICENSE file distributed with this work for additional
information regarding copyright ownership.

Except as contained in the LICENSE file, the name(s) of the above copyright
holders shall not be used in advertising or otherwise to promote the sale,
use or other dealings in this Software without prior written authorization.