Skip to content

Commit

Permalink
refactor: conventional var name for api key (#3964)
Browse files Browse the repository at this point in the history
  • Loading branch information
krtk6160 authored Feb 9, 2024
1 parent 2bfb760 commit 100e9a1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions apps/map/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Map

### local dev setup
This app uses Google Maps, therefore it requires a Google Maps API token:
### local dev setup

This app uses Google Maps, therefore it requires a Google Maps API key:

```
NEXT_PUBLIC_MAP_API_TOKEN
NEXT_PUBLIC_MAP_API_KEY
```

App run's on port `3005` by default.
2 changes: 1 addition & 1 deletion apps/map/components/map/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function MapComponent({ mapData }: MapComponentProps) {
}, [])

const { isLoaded } = useLoadScript({
googleMapsApiKey: env.NEXT_PUBLIC_MAP_API_TOKEN,
googleMapsApiKey: env.NEXT_PUBLIC_MAP_API_KEY,
libraries: libraries as any,
})

Expand Down
4 changes: 2 additions & 2 deletions apps/map/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export const env = createEnv({
CORE_URL: z.string().default("http://localhost:4455/graphql"),
},
client: {
NEXT_PUBLIC_MAP_API_TOKEN: z.string().default(""),
NEXT_PUBLIC_MAP_API_KEY: z.string().default(""),
},
runtimeEnv: {
CORE_URL: process.env.CORE_URL,
NEXT_PUBLIC_MAP_API_TOKEN: process.env.NEXT_PUBLIC_MAP_API_TOKEN,
NEXT_PUBLIC_MAP_API_KEY: process.env.NEXT_PUBLIC_MAP_API_KEY,
},
})

0 comments on commit 100e9a1

Please sign in to comment.