0.1.27 • Published 9 months ago
just-tron-auth v0.1.27
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
9 months ago
0.1.25
10 months ago
0.1.26
10 months ago
0.1.24
10 months ago
0.1.23
10 months ago
0.1.22
10 months ago
0.1.21
10 months ago
0.1.20
10 months ago
0.1.19
10 months ago
0.1.18
10 months ago
0.1.17
10 months ago
0.1.16
10 months ago
0.1.15
10 months ago
0.1.14
10 months ago
0.1.13
10 months ago
0.1.12
10 months ago
0.1.11
10 months ago
0.1.10
10 months ago
0.1.9
10 months ago
0.1.8
10 months ago
0.1.7
10 months ago
0.1.6
10 months ago
0.1.5
10 months ago
0.1.4
10 months ago
0.1.3
10 months ago
0.1.2
10 months ago
0.1.1
10 months ago
0.1.0
10 months ago