React component for a simple OAuth login with Crowdin.
Follow these steps to start using React Crowdin Login:
- Installation
# with npm
npm i @crowdin/react-crowdin-login
# with yarn
yarn add @crowdin/react-crowdin-login
- 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}
/>
);
};
- Find more info about keys and OAuth apps in official docs ― Creating an OAuth App
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 |
We are happy to accept contributions to the React Crowdin Login. To contribute please do the following:
- Fork the repository on GitHub.
- Decide which code you want to submit. Commit your changes and push to the new branch.
- Ensure that your code adheres to standard conventions, as used in the rest of the library.
- Submit a pull request with your patch on Github.
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.
- Alexandr Tovmach ([email protected])
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.