SDK

다양한 언어의 공식 SDK로 ONDA Channel API를 빠르게 연동하세요.

SDK

ONDA Channel API를 더 쉽게 사용할 수 있도록 다양한 프로그래밍 언어의 공식 SDK를 제공합니다.

서버 사이드 SDK (S2S)

서버 간 통신(Server-to-Server)에 최적화된 SDK입니다. OAuth 2.0 토큰 관리와 API 호출을 자동으로 처리합니다.

언어패키지GitHub
Node.js / TypeScript@onda/channel-nodeondame/onda-channel-node
Pythononda-channelondame/onda-channel-python
Javame.onda:channel-javaondame/onda-channel-java
PHPonda/channel-phpondame/onda-channel-php
JavaScript (Vanilla)@onda/channel-jsondame/onda-channel-js

클라이언트 사이드 SDK (S2B)

프론트엔드 앱에서 직접 ONDA API를 호출하기 위한 SDK입니다.

프레임워크패키지GitHub
React@onda/channel-reactondame/onda-channel-react
Next.js@onda/channel-nextjsondame/onda-channel-nextjs

빠른 시작

Node.js

npm install @onda/channel-node
import { OndaChannelClient } from "@onda/channel-node"

const client = new OndaChannelClient({
  clientId: process.env.ONDA_CLIENT_ID,
  clientSecret: process.env.ONDA_CLIENT_SECRET,
})

const properties = await client.properties.list({ page: 1, size: 20 })

Python

pip install onda-channel
from onda_channel import OndaChannelClient

client = OndaChannelClient(
    client_id=os.environ["ONDA_CLIENT_ID"],
    client_secret=os.environ["ONDA_CLIENT_SECRET"],
)

properties = client.properties.list(page=1, size=20)

React

npm install @onda/channel-react
import { useProperties } from "@onda/channel-react"

export function PropertyList() {
  const { data, isLoading } = useProperties({ page: 1, size: 20 })

  if (isLoading) return <div>Loading...</div>
  return <ul>{data?.items.map(p => <li key={p.id}>{p.name}</li>)}</ul>
}

SDK 없이 연동하기

SDK 없이도 RESTful API를 직접 호출하여 연동할 수 있습니다.

curl -X GET "https://api.onda.me/channel/v1/properties" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json"

다음 단계