0.1.27 • Published 8 months ago

just-tron-auth v0.1.27

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

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>
    );
}
0.1.27

8 months ago

0.1.25

9 months ago

0.1.26

9 months ago

0.1.24

9 months ago

0.1.23

9 months ago

0.1.22

9 months ago

0.1.21

9 months ago

0.1.20

9 months ago

0.1.19

9 months ago

0.1.18

9 months ago

0.1.17

9 months ago

0.1.16

9 months ago

0.1.15

9 months ago

0.1.14

9 months ago

0.1.13

9 months ago

0.1.12

9 months ago

0.1.11

9 months ago

0.1.10

9 months ago

0.1.9

9 months ago

0.1.8

9 months ago

0.1.7

9 months ago

0.1.6

9 months ago

0.1.5

9 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago