z3ro0k / react-use-lanyard

πŸš€ Use Lanyard API easily in your React app!

Home Page:https://npmjs.com/react-use-lanyard

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stars license supportServer forks issues

Logo

React Use Lanyard

Use Lanyard API easily in your React app!
Get support Β»

Report Bug Β· Request Feature Β· What Is Lanyard

πŸ“¦ Installation

  • Using yarn: yarn add react-use-lanyard
  • Using npm: npm i react-use-lanyard

πŸ€“ Usage

Using without websocket:

import { useLanyard } from "react-use-lanyard";

function App() {
	const lanyard = useLanyard({
		userId: "331846231514939392",
	});

	return (
		<pre>{!lanyard.isValidating && JSON.stringify(lanyard, null, 4)}</pre>
	);
}

export default App;

Using with websocket:

import { useLanyard } from "react-use-lanyard";

function App() {
	const { loading, status /*, websocket */ } = useLanyard({
		userId: "331846231514939392",
		socket: true,
	});

	return <pre>{!loading && JSON.stringify(status, null, 4)}</pre>;
}

export default App;

πŸ“„ License

Copyright © 2021 Barış DEMİRCİ.

Distributed under the GPL-3.0 License. See LICENSE for more information.

🧦 Contributing

Feel free to use GitHub's features.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/my-feature)
  3. Run prettier and eslint (npm run format && npm run lint)
  4. Commit your Changes (git commit -m 'my awesome feature my-feature')
  5. Push to the Branch (git push origin feature/my-feature)
  6. Open a Pull Request

πŸ”₯ Show your support

Give a ⭐️ if this project helped you!

πŸ“ž Contact

✨ Special Thanks

About

πŸš€ Use Lanyard API easily in your React app!

https://npmjs.com/react-use-lanyard

License:GNU General Public License v3.0


Languages

Language:TypeScript 100.0%