0.1.27 • Published 12 months ago

just-tron-auth v0.1.27

Weekly downloads
-
License
MIT
Repository
-
Last release
12 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

12 months ago

0.1.25

12 months ago

0.1.26

12 months ago

0.1.24

1 year ago

0.1.23

1 year ago

0.1.22

1 year ago

0.1.21

1 year ago

0.1.20

1 year ago

0.1.19

1 year ago

0.1.18

1 year ago

0.1.17

1 year ago

0.1.16

1 year ago

0.1.15

1 year ago

0.1.14

1 year ago

0.1.13

1 year ago

0.1.12

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago