UNPKG

next-auth-pubkey

Version:

A light-weight Lightning and Nostr auth provider for your Next.js app that's entirely self-hosted and plugs seamlessly into the next-auth framework.

19 lines 1.02 kB
/** * A React hook that, on mount, will trigger an API request and create a new Lightning auth session. * Thereafter, it'll poll the API and checks if the Lightning auth QR has been scanned. * If enough time elapses without a sign in attempt, the Lightning auth session will be refreshed. * Once a success status is received from polling, the user will be redirected to the `next-auth` redirect url. * * This hook is designed for use in the pages router, it's not recommended for use in the app router. * * @returns {Object} * @returns {String} lnurl - the raw LNURL, should be made available for copy-pasting * @returns {String} qr - a url pointing the lnurl-auth QR Code image, should be used in the src prop of img tags * @returns {String} button - a deep-link that will open in Lightning enabled wallets, should be used in the href prop of anchor tags */ export declare function useLightningAuth(): { lnurl: string; qr: string; button: string; }; //# sourceMappingURL=useLightningAuth.d.ts.map