@txwallet/auth-browser
v1.0.0
Published
Browser SDK for Sign in with TX Wallet.
Maintainers
Readme
@txwallet/auth-browser
Browser helper for Sign in with TX Wallet.
npm install @txwallet/auth-browserimport { createTxWalletAuthClient } from '@txwallet/auth-browser';
const txWalletAuth = createTxWalletAuthClient({
requestOptions: {
endpoint: '/api/tx-wallet/signin/requests',
callbackUrl: `${location.origin}/tx-wallet/callback`,
statement: 'Sign in to Example with TX Wallet.',
},
});
txWalletAuth.on('approved', () => {
location.assign('/dashboard');
});
document.querySelector('#tx-wallet-sign-in').addEventListener('click', () => {
txWalletAuth.launchSignIn();
});Auth signs an off-chain ADR-36 proof. It does not move funds and does not submit an on-chain transaction.
