### ๐Ÿ—๏ธ **Dev Log Drop: Custom Hive Authentication Package!** ๐Ÿ› ๏ธ Hey party people of Hive! ๐Ÿ™‹โ€โ™‚๏ธ Letโ€™s crank the dev updates up to eleven, sprinkle a dash of memes, and bring some buzz to the blockchain! ๐Ÿ --- #### ๐Ÿ˜… **Why Not Stick to Just Aioha?** I've used [@aioha package](https://aioha.dev/) like itโ€™s my morning chai ๐Ÿตโ€”everywhere: distriator, checkinwithxyz, and the 3speak-refactor mobile app! But, plot twist, we decided to ride one scooter further and build our own custom package (on top of it). Why? Well, because facing setbacks is just part of building on the bleeding edgeโ€”and, honestly, who doesnโ€™t like doing things their own way sometimes? ๐Ÿ˜ ![but why](https://media.tenor.com/dpf3lR2WCG0AAAAC/capisce-owl.gif) - Custom User Interface (because users want their apps looking fancy ๐Ÿ’„) - Custom Data Storage (we want _our_ tokens, _our_ types, and our own flavor ๐ŸŒถ๏ธ) - Async logic for logins (because we absolutely must call our APIs! ๐Ÿค–) - Fan-demand: support login with private key for multiple users (not just me anymore!) --- ### ๐Ÿค– **Introducing... HiveAuthentication (Name Sucks, Help Wanted! ๐Ÿ˜‚)** Time to take matters into our own handsโ€”UI hands, that is! Weโ€™re making an open-source package (WIP name: `hive-authentication`, cheers for ideas!). Drop your brilliant/crazy/funny name suggestions in the commentsโ€”winner gets karma, eternal gratitude, and a virtual high five! โœ‹ - 100% open-source for Hive fam - Minimal dependenciesโ€”lightweight is tight! ๐Ÿชถ - Repo here: https://github.com/sag333ar/hive-authentication ![not the first time](https://media.tenor.com/aSAnZ55pUasAAAAC/its-been-so-long-fernanda-ramirez.gif) > - Is this our third attempt? Yes. > - Did we crash and burn before? Also yes. > - Am I more hopeful than ever? ABSOL --- ### ๐Ÿ‘€ **Sneak Peak - UI Unveiled!** ![Sneak peak](https://files.peakd.com/file/peakd-hive/sagarkothari88/23vhPnAibYPj7azefzPwYGkDEKMiDywjo1Vmcyjs7TMBkKx6TTYi7JBcMhRBZQzQrkwHK.png) Check the glow-up! When users hit "login", they get this snazzy new UI. Options: - Enter username, choose login flavor ๐Ÿ˜‹ - Working options: keychain, hiveauth, posting key More to come, but this is everything weโ€™ve polished so far. โœจ --- ### โš›๏ธ **ReactJS Integration = Breezy!** ๐ŸŒฌ๏ธ ![reactjs](https://media.tenor.com/_sRq7f0tQLEAAAAC/reactjs.gif) #### **Installation (Spoiler: Itโ€™s Easy!)** ``` npm install hive-authentication ``` Install the package. It will take care of adding aioha internally. #### Let's not break UI ``` import 'hive-authentication/build.css'; ``` Wherever you plan to use hive-authentication package's button, make sure you import the build.css file so that you don't break UX we have supplied in the package. #### Code Snippet ![code snippet](https://media.tenor.com/Ia8cfKygnJIAAAAC/insert-code-here-coding.gif) ``` import { AuthButton, useAuthStore } from 'hive-authentication'; function App() { const { currentUser, loggedInUsers } = useAuthStore(); // Subscribe to store changes using Zustand useEffect(() => { const unsubscribe = useAuthStore.subscribe((state) => { console.log('Store state changed:', state); }); return unsubscribe; }, []); // Your authentication callback - works for both login AND adding accounts const handleAuthenticate = async (hiveResult) => { // Make your API call here const response = await fetch('/api/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ challenge: hiveResult.challenge, username: hiveResult.username, pubkey: hiveResult.publicKey, proof: hiveResult.proof, }), }); if (!response.ok) { throw new Error('Server authentication failed'); } const data = await response.json(); // Return your server response as JSON string return JSON.stringify(data); }; return (

My App

<AuthButton onAuthenticate={handleAuthenticate} /> {currentUser && (

Welcome, {currentUser.username}!

)}
); } ``` ### That's it ![that is it](https://media.tenor.com/OzS-0ePJMpcAAAAC/that%27s-it-marques-brownlee.gif) Yep. That is it. Your reactjs app is ready with login/authentication. Easy peasy. Give it a try & share your feedback if you are a dev. --- # ๐ŸŽ‰ The Hive Hype Never Stops ๐Ÿš‚ - ๐Ÿ™Œ Keep building open source for hive - ๐Ÿ’ Big love to Hive fam for feedback & support - ๐Ÿ“ˆ Hive blockchain = ๐Ÿš€๐ŸŒŒ all the way to the moon, Mars & beyond! ![Hive magic](https://media.tenor.com/RPXnCANqkIQAAAAC/hive-magic-magic.gif) ๐Ÿ”ฅ Until the next dev log โ€” **Keep building, keep Hiving!** ๐Ÿ๐Ÿ’œ --- ### ๐Ÿ“ Final Note - I asked perplexity to help optimize this post to make it more readable and viewer-friendly. - Here is the link where you can find both original content & improvements made by AI - https://www.perplexity.ai/search/e3e4a8ed-6cf2-46a4-b539-81866c27acb1 --- ### ๐Ÿš€ My Contributions to โ™ฆ๏ธ Hive Ecosystem | Contribution | To | Hive | Ecosystem | |--------------|----|------|-----------| | Hive Witness Node | Hive API Node (in progress) | 3Speak Video Encoder Node Operator (highest number of nodes) | 3Speak Mobile App Developer | | 3Speak Podcast App Developer | 3Speak Shorts App Developer | 3Speak Support & Maintenance Team | [Distriator Developer](https://distriator.com/) | | [CheckinWithXYZ](https://checkinwith.xyz/) | [Hive Inbox](https://hive-inbox.the-hive-mobile.app/) | [HiFind](https://hifind.the-hive-mobile.app/) | [Hive Donate App](https://donate.the-hive-mobile.app/) | | Contributed to HiveAuth Mobile App | Ecency โ†” 3Speak Integration | Ecency โ†” InLeo Integration | Ecency โ†” Actifit Integration | | [Hive Stats App](https://stats.the-hive-mobile.app/) | [Vote for Witness App](https://witness.the-hive-mobile.app/) | [HiveFlutterKit](https://hiveflutterkit.sagarkothari88.one/docs/intro) | [New 3Speak App](https://3speak.sagarkothari88.one/#/?tab=home) | --- ### ๐Ÿ™Œ Support Back โค๏ธ **Appreciate my work? Consider supporting @threespeak & @sagarkothari88!** โค๏ธ | Vote | For | Witness | |------|-----|---------| | [![](https://images.hive.blog/u/sagarkothari88/avatar)](https://witness.the-hive-mobile.app/#/witnesses/@sagarkothari88) | [sagarkothari88](https://witness.the-hive-mobile.app/#/witnesses/@sagarkothari88) | @sagarkothari88 | | [![](https://images.hive.blog/u/threespeak/avatar)](https://witness.the-hive-mobile.app/#/witnesses/@threespeak) | [threespeak](https://witness.the-hive-mobile.app/#/witnesses/@threespeak) | @threespeak | ---