@caor/aligo
v0.1.0
Published
Universal Aligo Kakao message API client for server, browser, and CLI.
Maintainers
Readme
@caor/aligo
Universal Aligo Kakao message API client for server, browser, and CLI.
The client is based on docs/알리고문자/알리고 문자.md and uses only standard fetch, URLSearchParams, and FormData APIs.
Install
npm install @caor/aligoServer Usage
import { AligoClient } from "@caor/aligo";
const aligo = new AligoClient({
apiKey: process.env.ALIGO_API_KEY,
userId: process.env.ALIGO_USER_ID
});
await aligo.alimtalk.send({
senderKey: "sender-profile-key",
templateCode: "TXXXXXXXX",
sender: "0212345678",
messages: [{
receiver: "01012345678",
receiverName: "홍길동",
subject: "예약 안내",
message: "홍길동님 예약이 확정되었습니다."
}]
});Browser Usage
The package can run in browsers because it is fetch-based. Do not expose apiKey in public frontend code. Use a backend route or edge function as a proxy, then call that route from the browser.
CLI
export ALIGO_API_KEY="..."
export ALIGO_USER_ID="..."
aligo profile categories
aligo template list --sender-key "sender-profile-key"
aligo alimtalk send \
--sender-key "sender-profile-key" \
--template-code "TXXXXXXXX" \
--sender "0212345678" \
--receiver "01012345678" \
--subject "예약 안내" \
--message "예약이 확정되었습니다."API Surface
client.profile.requestAuth()client.profile.categories()client.profile.add()client.profile.list()client.template.list()client.template.add()client.template.modify()client.template.remove()client.template.requestReview()client.alimtalk.send()client.brandtalk.createTemplate()client.brandtalk.listTemplates()client.brandtalk.send()client.history.list()client.history.detail()client.account.remain()client.cancel()client.raw()
Objects and arrays passed to JSON-string fields such as button, templateButton, templateCoupon, and carouselList are serialized automatically. When a Blob or File is included, the request is sent as FormData; otherwise it is sent as application/x-www-form-urlencoded.
By default the client throws AligoApiError for API-level failures. Pass throwOnApiError: false to receive raw API responses.
