@@ -2,7 +2,7 @@ import { useConnectModal } from "@rainbow-me/rainbowkit";
22import { useCallback , useEffect , useMemo , useRef , useState } from "react" ;
33import { useAccount , useConfig , useConnections } from "wagmi" ;
44import { signMessage , signTypedData , switchChain } from "wagmi/actions" ;
5- import { LensClient , production } from "@lens-protocol/client" ;
5+ import { LensClient , development , production } from "@lens-protocol/client" ;
66import type {
77 SignerStateActionContext ,
88 SignerStateInstance ,
@@ -65,13 +65,18 @@ type LensIdentityOptions = {
6565 * @defaultValue "lensProfile"
6666 */
6767 storageKey ?: string ;
68+ /**
69+ * @defaultValue "production"
70+ */
71+ environment ?: "production" | "development" ;
6872} ;
6973
7074const defaultStorage = new WebStorage ( ) ;
7175
7276export function useLensIdentity ( {
7377 storage = defaultStorage ,
7478 storageKey = "lensProfile" ,
79+ environment = "production" ,
7580} : LensIdentityOptions = { } ) : LensSignerInstance {
7681 const storageRef = useRef ( storage ) ;
7782 const [ isLoading , setIsLoading ] = useState ( false ) ;
@@ -85,7 +90,7 @@ export function useLensIdentity({
8590
8691 const lensClient = useRef (
8792 new LensClient ( {
88- environment : production ,
93+ environment : environment === "development" ? development : production ,
8994 } )
9095 ) . current ;
9196
0 commit comments