Skip to content

Commit

Permalink
feat: KAKAO MAP 환경변수 추가 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
xilucks committed Jul 23, 2024
1 parent a404565 commit 04b1204
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
10 changes: 6 additions & 4 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ KAKAO_CLIENT_ID=
KAKAO_CLIENT_SECRET=
KAKAO_REDIRECT_URI=

KAKAO_MAP_BASE_URL=
KAKAO_MAP_API_KEY=
DAUMCDN_POSTOCDE_URL=

## NAVER
### @see https://developers.naver.com/apps/#/myapps/f4vceVr1QiIcw1FITmMo/overview
NAVER_CLIENT_ID=
NAVER_CLIENT_SECRET=
NAVER_REDIRECT_URI=

## KAKAO MAP
### @see https://developers.kakao.com/console/app/1102339/config/appKey
KAKAO_MAP_BASE_URL=
KAKAO_MAP_API_KEY=
DAUMCDN_POSTOCDE_URL=
5 changes: 3 additions & 2 deletions src/app/(playground)/playground/map/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Script from "next/script";
import { env } from "~/lib/env";

export default function KaKaoMapPageLayout({
children,
Expand All @@ -10,12 +11,12 @@ export default function KaKaoMapPageLayout({
<Script
strategy="beforeInteractive"
type="text/javascript"
src={`${process.env.NEXT_PUBLIC_DAUMCDN_POSTOCDE_URL}`}
src={`${env.DAUMCDN_POSTOCDE_URL}`}
/>
<Script
strategy="beforeInteractive"
type="text/javascript"
src={`${process.env.NEXT_PUBLIC_KAKAO_MAP_BASE_URL}?appkey=${process.env.NEXT_PUBLIC_KAKAO_MAP_API_KEY}&libraries=services&autoload=false`}
src={`${env.KAKAO_MAP_BASE_URL}?appkey=${env.KAKAO_MAP_API_KEY}&libraries=services&autoload=false`}
/>
{children}
</>
Expand Down
4 changes: 4 additions & 0 deletions src/lib/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ export const env = createEnv({
NAVER_CLIENT_ID: z.string(),
NAVER_CLIENT_SECRET: z.string(),
NAVER_REDIRECT_URI: z.string(),
/* ---- KaKao Map ---- */
KAKAO_MAP_BASE_URL: z.string(),
KAKAO_MAP_API_KEY: z.string(),
DAUMCDN_POSTOCDE_URL: z.string(),
},
client: {},
experimental__runtimeEnv: {},
Expand Down

0 comments on commit 04b1204

Please sign in to comment.