0.1.27 • Published 1 year 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-authimport { 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
1 year ago
0.1.25
1 year ago
0.1.26
1 year ago
0.1.24
2 years ago
0.1.23
2 years ago
0.1.22
2 years ago
0.1.21
2 years ago
0.1.20
2 years ago
0.1.19
2 years ago
0.1.18
2 years ago
0.1.17
2 years ago
0.1.16
2 years ago
0.1.15
2 years ago
0.1.14
2 years ago
0.1.13
2 years ago
0.1.12
2 years ago
0.1.11
2 years ago
0.1.10
2 years ago
0.1.9
2 years ago
0.1.8
2 years ago
0.1.7
2 years ago
0.1.6
2 years ago
0.1.5
2 years ago
0.1.4
2 years ago
0.1.3
2 years ago
0.1.2
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago