Skip to content

Commit

Permalink
Update clientId to be fetched from environment variable in web3-auth-…
Browse files Browse the repository at this point in the history
…connector.ts
  • Loading branch information
Royal-lobster committed Sep 2, 2024
1 parent 7cef9c2 commit 5eb94d9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/integrations/web3-auth-connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ import { EthereumPrivateKeyProvider } from '@web3auth/ethereum-provider'
import { Web3Auth } from '@web3auth/modal'
import { WalletServicesPlugin } from '@web3auth/wallet-services-plugin'
import { Web3AuthConnector } from '@web3auth/web3auth-wagmi-connector'
import { env } from 'node:process'
import type { Chain } from 'viem'
import { createConnector } from 'wagmi'

if (!env.NEXT_PUBLIC_WEB3_AUTH_CLIENT_ID) {
throw new Error('NEXT_PUBLIC_WEB3_AUTH_CLIENT_ID is not set')
}

const clientId = env.NEXT_PUBLIC_WEB3_AUTH_CLIENT_ID

export const rainbowWeb3AuthConnector = ({
chain,
}: { chain: Chain }): Wallet => {
Expand All @@ -31,8 +38,7 @@ export const rainbowWeb3AuthConnector = ({
})

const web3AuthInstance = new Web3Auth({
clientId:
'BPi5PB_UiIZ-cPz1GtV5i1I2iOSOHuimiXBI0e-Oe_u6X3oVAbCiAZOTEBtTXw4tsluTITPqA8zMsfxIKMjiqNQ',
clientId,
chainConfig,
privateKeyProvider,
uiConfig: {
Expand Down

0 comments on commit 5eb94d9

Please sign in to comment.