UNPKG

@dynamic-labs/sdk-react-core

Version:

A React SDK for implementing wallet web3 authentication and authorization to your website.

23 lines (18 loc) 845 B
'use client' 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var React = require('react'); var ConnectWithOtpContext = require('./ConnectWithOtpContext.cjs'); const useConnectWithOtp = ({ emailProvider: defaultProvider, } = {}) => { const context = React.useContext(ConnectWithOtpContext.ConnectWithOtpContext); if (!context) { throw new Error('useConnectWithOtp must be used within a DynamicContextProvider'); } return { connectWithEmail: (email, options = {}) => context.connectWithEmail(email, Object.assign({ provider: defaultProvider }, options)), connectWithSms: context.connectWithSms, retryOneTimePassword: context.retryOneTimePassword, verifyOneTimePassword: context.verifyOneTimePassword, }; }; exports.useConnectWithOtp = useConnectWithOtp;