@handwoo24/kakao
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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 }} />
    )
}

Package Sidebar

Install

npm i @handwoo24/kakao

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

34.4 kB

Total Files

42

Last publish

Collaborators

  • handwoo24