Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/large-baboons-notice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frames.js": minor
---

Adds support for Lens development environment in use-lens-identity
9 changes: 7 additions & 2 deletions packages/render/src/identity/lens/use-lens-identity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useConnectModal } from "@rainbow-me/rainbowkit";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useAccount, useConfig, useConnections } from "wagmi";
import { signMessage, signTypedData, switchChain } from "wagmi/actions";
import { LensClient, production } from "@lens-protocol/client";
import { LensClient, development, production } from "@lens-protocol/client";
import type {
SignerStateActionContext,
SignerStateInstance,
Expand Down Expand Up @@ -65,13 +65,18 @@ type LensIdentityOptions = {
* @defaultValue "lensProfile"
*/
storageKey?: string;
/**
* @defaultValue "production"
*/
environment?: "production" | "development";
};

const defaultStorage = new WebStorage();

export function useLensIdentity({
storage = defaultStorage,
storageKey = "lensProfile",
environment = "production",
}: LensIdentityOptions = {}): LensSignerInstance {
const storageRef = useRef(storage);
const [isLoading, setIsLoading] = useState(false);
Expand All @@ -85,7 +90,7 @@ export function useLensIdentity({

const lensClient = useRef(
new LensClient({
environment: production,
environment: environment === "development" ? development : production,
})
).current;

Expand Down
Loading