1.0.2 • Published 9 months ago

@handwoo24/kakao v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

A Kakao API for nextjs

Auth Example

"authorize-page.tsx"

export default function Page() {
  return <KakaoAuthorizeButton apiKey="your api key" />
}
"redirect-page.tsx"

interface PageProps {
  searchParams?: {
    code?: string
  }
}

const redirectUri = "your redirect uri"
const apiKey = "your kakao js client api key"

export default async function Page({ searchParams: { code } }: PageProps) {
  if (typeof code !== 'string') return redirect('/')
  const { access_token } = await getKakaoToken({code, redirectUri, apiKey})
  const kakaoUser = await getKakaoUser(access_token)
  return ...
}

Map Example

const Map = () => {
  return (
      <KakaoMap apiKey="your api key" lat={33.450701} lng={126.570667} level={3} style={{ width: 500, height: 500 }} />
    )
}
1.0.2

9 months ago