Skip to content

Commit 09e2efa

Browse files
iPaulPronormanzb
authored andcommitted
feat: adds support for Lens development environment in use-lens-identity
1 parent fe7cd94 commit 09e2efa

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.changeset/large-baboons-notice.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"frames.js": minor
3+
---
4+
5+
Adds support for Lens development environment in use-lens-identity

packages/render/src/identity/lens/use-lens-identity.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useConnectModal } from "@rainbow-me/rainbowkit";
22
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
33
import { useAccount, useConfig, useConnections } from "wagmi";
44
import { signMessage, signTypedData, switchChain } from "wagmi/actions";
5-
import { LensClient, production } from "@lens-protocol/client";
5+
import { LensClient, development, production } from "@lens-protocol/client";
66
import 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

7074
const defaultStorage = new WebStorage();
7175

7276
export 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

Comments
 (0)