
npm install --save react-method-link
importReactfrom'react';import{useMethodLink}from'react-method-link';constApp=()=>{constmyAPIClient={exchangeLinkToken: (data)=>{},generateLinkToken: (options)=>{},};const{ openWithToken }=useMethodLink({env: 'dev',// Defaults to 'dev'. Use 'production' when you're ready to go live.onOpen: ()=>{},onExit: ()=>{},onError: (error)=>{},onSuccess: data=>myAPIClient.exchangeLinkToken(data),});constonClick=async()=>{consttoken=awaitmyAPIClient.generateLinkToken({});openWithToken(token);};return(<div><header><buttontype="button"onClick={onClick}>
Open Method Link
</button></header></div>);};