just-tron-auth
TypeScript icon, indicating that this package has built-in type declarations

0.1.27 • Public • Published

Just Auth

A simple authentication library for Tron dApps.

Details developer docs can be found at: https://just-auth.gitbook.io

Installation

npm install just-tron-auth
import { JustAuthProvider } from 'just-tron-auth';
function App() {
    return (
        <JustAuthProvider appId="your-app-id">
            <YourApp />
        </JustAuthProvider>
    );
}
import { useJustAuth } from 'just-tron-auth';
function YourComponent() {
    const { isAuthenticated, userAddress, openAuthModal, signMessage, exportPrivateKey, logout } = useJustAuth();

    if (!isAuthenticated) {
    return <button onClick={openAuthModal}>Login</button>;
    }

    return (
    <div>
        <p>Welcome, {userAddress}</p>
        <button onClick={() => signMessage('Hello, World!')}>Sign Message</button>
        <button onClick={exportPrivateKey}>Export Private Key</button>
        <button onClick={logout}>Logout</button>
    </div>
    );
}

Package Sidebar

Install

npm i just-tron-auth

Weekly Downloads

5

Version

0.1.27

License

MIT

Unpacked Size

3.1 MB

Total Files

20

Last publish

Collaborators

  • gaurav2026