Skip to content

Commit

Permalink
Move all creds to the env file
Browse files Browse the repository at this point in the history
  • Loading branch information
Agusx1211 committed Nov 15, 2023
1 parent e4ab35e commit 24cf63a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
VITE_API_HOST=

# Get these from https://console.cloud.google.com/apis/credentials
VITE_GOOGLE_CLIENT_ID=
# Or use these for development purposes only, NOTICE: will only work on localhost:3000
VITE_GOOGLE_CLIENT_ID=970987756660-35a6tc48hvi8cev9cnknp0iugv9poa23.apps.googleusercontent.com

# Use this Sequence API key for development purposes only
VITE_SEQUENCE_API_KEY=eyJzZWNyZXQiOiJ0YmQiLCJ0ZW5hbnQiOjksImlkZW50aXR5UG9vbElkIjoidXMtZWFzdC0yOjQyYzlmMzlkLWM5MzUtNGQ1Yy1hODQ1LTVjODgxNWM3OWVlMyIsImVtYWlsQ2xpZW50SWQiOiI1Zmw3ZGc3bXZ1NTM0bzl2ZmpiYzZoajMxcCIsImlkcFJlZ2lvbiI6InVzLWVhc3QtMjo0MmM5ZjM5ZC1jOTM1LTRkNWMtYTg0NS01Yzg4MTVjNzllZTMifQ==
8 changes: 5 additions & 3 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ import App from './App.tsx'
import { ethers } from 'ethers'
import { defaults } from '@0xsequence/waas'

export const CLIENT_ID = import.meta.env.VITE_GOOGLE_CLIENT_ID
const GOOGLE_CLIENT_ID = import.meta.env.VITE_GOOGLE_CLIENT_ID
const SEQUENCE_API_KEY = import.meta.env.VITE_SEQUENCE_API_KEY

export const node = new ethers.providers.JsonRpcProvider('https://nodes.sequence.app/polygon')

export const sequence = new Sequence({
network: 'polygon',
key: 'eyJzZWNyZXQiOiJ0YmQiLCJ0ZW5hbnQiOjksImlkZW50aXR5UG9vbElkIjoidXMtZWFzdC0yOjQyYzlmMzlkLWM5MzUtNGQ1Yy1hODQ1LTVjODgxNWM3OWVlMyIsImVtYWlsQ2xpZW50SWQiOiI1Zmw3ZGc3bXZ1NTM0bzl2ZmpiYzZoajMxcCJ9',
key: SEQUENCE_API_KEY,
idpRegion: 'us-west-2'
}, defaults.TEMPLATE_NEXT)

export const router = createHashRouter([
Expand All @@ -34,7 +36,7 @@ export const router = createHashRouter([
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<ThemeProvider>
<GoogleOAuthProvider clientId={CLIENT_ID}>
<GoogleOAuthProvider clientId={GOOGLE_CLIENT_ID}>
<RouterProvider router={router} />
</GoogleOAuthProvider>
</ThemeProvider>
Expand Down

0 comments on commit 24cf63a

Please sign in to comment.