@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
JavaScript
'use client'
;
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;