---
updatedAt: 2025-03-19T23:24:43.000Z
agentTools:
  projectIndex: https://sdk.sendon.io/llms.txt
---

# [SDK] 카카오 템플릿 이미지 업로드

```javascript JavaScript
import { Sendon } from '@alipeople/sendon-sdk-typescript'
import fs from 'fs'

const sendon = new Sendon({
  id: 'SENDON_ID',
  apikey: 'SENDON_APIKEY',
  debug: false,
})

async function example() {
  const imageFile = fs.readFileSync('./images/sample.jpg')
  const file = new File([imageFile], 'sample.jpg', { type: 'image/jpeg' })
  const result = await sendon.kakao.uploadAlimTalkTemplateImage(file)
  
  console.log(`Response: ${JSON.stringify(result, null, 2)}`)
}

example()
```

```json Response Example
{
  "code": 200,
  "message": "성공",
  "data": {
    "imageUrl": "https://example.com/i1a2b3c4-d5e6-f7g8-h9i0-j1k2l3m4n5o6.png"
  }
}
```

# Sendon 인스턴스 생성

<!-- javascript@3-7 -->

- SDK를 초기화하고 인증 정보(ID, API Key)를 설정합니다.
- 개발 환경에서는 debug 옵션을 활성화하여 로깅을 확인할 수 있습니다.

# 카카오 템플릿 이미지 업로드 요청

<!-- javascript@10-12 -->

- 로컬 파일 시스템에서 이미지를 읽어와 File 객체로 변환합니다
- 생성된 이미지 파일을 카카오 알림톡 템플릿에서 사용할 수 있도록 업로드합니다