Skip to content
Merged
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
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,12 @@ Add this line to your CSS entry point (e.g., `app/globals.css`):

```tsx
// app/layout.tsx
import { IqLoginProvider } from "@everipedia/iq-login/client";
import { IqLoginProvider, createIqLoginConfig } from "@everipedia/iq-login/client";
import { headers } from "next/headers";
import { getWagmiConfig } from "@everipedia/iq-login";
import { fraxtal } from "viem/chains";

// Get the Wagmi config. It is important that this is outside the component
const wagmiConfig = getWagmiConfig([fraxtal])
// Create the config. It is important that this is outside the component
const config = createIqLoginConfig([fraxtal])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve clarity for developers using this package, it would be beneficial to add a comment indicating that createIqLoginConfig defaults to mainnet if no chains are provided. This helps users understand the default behavior without needing to check the source code.

Suggested change
const config = createIqLoginConfig([fraxtal])
const config = createIqLoginConfig([fraxtal]) // Defaults to [mainnet] if no chains are provided


export default async function RootLayout({
children,
Expand All @@ -71,9 +70,8 @@ export default async function RootLayout({
<IqLoginProvider
projectName="YOUR_PROJECT_NAME"
cookie={cookie}
wagmiConfig={wagmiConfig}
config={config}
// Optional props:
// chains={[mainnet]} // Default: mainnet
// disableAuth={false} // Default: false
>
{children}
Expand All @@ -84,7 +82,7 @@ export default async function RootLayout({
}
```

You can use any chain supported by viem. Import your desired chain from 'viem/chains' and pass it to the IqLoginProvider:
You can use any chain supported by viem. Import your desired chain from 'viem/chains' and pass it to the `createIqLoginConfig` function.

4. Add login page to your application:

Expand Down
Loading