Skip to content

Commit

Permalink
Enable passing down chain and api key from provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Royal-lobster committed Nov 26, 2024
1 parent 642915a commit 16efa40
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/rare-turtles-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@everipedia/iq-login": major
---

Enable passing down chain and api key from provider.
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,7 @@ pnpm install @everipedia/iq-login [email protected] [email protected] @rainbow-me/rainbowkit@2

## 🛠️ Setup

1. Setup Environment Variables

```bash
# .env

NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=YOUR_PROJECT_ID
NEXT_PUBLIC_IS_PRODUCTION=true/false
NEXT_PUBLIC_WEB3_AUTH_CLIENT_ID=YOUR_CLIENT_ID
```

2. Add the package to your Tailwind CSS configuration:
1. Add the package to your Tailwind CSS configuration:
```tsx
// tailwind.config.ts

Expand All @@ -41,12 +31,13 @@ const config: Config = {
export default config;


3. Wrap your application with the RainbowKitClientProvider in your layout file:
2. Wrap your application with the RainbowKitClientProvider in your layout file:

```tsx
// app/layout.tsx
import { RainbowKitClientProvider } from "@everipedia/iq-login";
import { polygon } from 'wagmi/chains';
export default function RootLayout({
children,
Expand All @@ -56,14 +47,19 @@ export default function RootLayout({
return (
<html lang="en">
<body>
<RainbowKitClientProvider>{children}</RainbowKitClientProvider>
<IqLoginProvider
chain={polygon} // Required: Specify the chain to use
web3AuthProjectId="YOUR_PROJECT_ID" // Required: Web3Auth Project ID
>
{children}
</IqLoginProvider>
</body>
</html>
);
}
```

4. Add login page to your application. Note: You need to import rainbowkit styles in your application.
3. Add login page to your application. Note: You need to import rainbowkit styles in your application.
```tsx
// app/login/page.tsx
Expand Down

0 comments on commit 16efa40

Please sign in to comment.