'use client' import Image from 'next/image' import React, {useEffect, useRef } from 'react' export default function Home() { const iota = useRef() const isInited = useRef(false) const init = async () => { if (typeof window !== 'undefined') { if (isInited.current) return isInited.current = true const IotaSDK = await import('tanglepaysdk-client') iota.current = IotaSDK iota.current.default._events.on('iota-ready',async ()=>{ console.log('iota-ready') const connectRes = await iota.current.default.request({ method: 'iota_connect', params: { // expires: 3000000 }, }); console.log('connectRes', connectRes) }) iota.current.default.onLoad() } } useEffect(() => { init() }, []) return (

Get started by editing  src/app/page.tsx

By{' '} Vercel Logo
Next.js Logo

Docs{' '} ->

Find in-depth information about Next.js features and API.

Learn{' '} ->

Learn about Next.js in an interactive course with quizzes!

Templates{' '} ->

Explore the Next.js 13 playground.

Deploy{' '} ->

Instantly deploy your Next.js site to a shareable URL with Vercel.

) }