Coupang Partners Authentication Library for Node.js and TypeScript
npm install coupang-partners-sdk-standalone


μΏ ν‘ ννΈλμ€ APIλ₯Ό μ½κ² μ¬μ©ν μ μλλ‘ λμμ£Όλ TypeScript/JavaScript SDKμ λλ€.
- π μλ μΈμ¦: HMAC SHA256 CEA μλͺ
μλ μμ±
- π TypeScript μ§μ: μμ ν νμ
μμ μ± μ 곡
- π λ€μν API μ§μ: μνκ²μ, GoldBox, CoupangPL, λ₯λ§ν¬ API
- π‘οΈ ν₯μλ μλ¬ νΈλ€λ§: HTTP μλ¬, JSON νμ± μλ¬ μλ μ²λ¦¬
- π μλ μ¬μλ: λ€νΈμν¬ μ€λ₯ μ μλ μ¬μλ λ‘μ§
- π μμΈ λ‘κΉ
: ꡬ쑰νλ λ‘κΉ
μμ€ν
κ³Ό λλ²κ·Έ λͺ¨λ
- π§ͺ ν
μ€νΈ UI: μ€μκ° API ν
μ€νΈλ₯Ό μν μΉ μΈν°νμ΄μ€ μ 곡
``bash`
npm install coupang-partners-sdk-standalone
`bash`
yarn add coupang-partners-sdk-standalone
`typescript
import { CoupangPartnersClient } from 'coupang-partners-sdk-standalone';
const client = new CoupangPartnersClient({
accessKey: 'your-access-key',
secretKey: 'your-secret-key',
});
`
`typescript
// ν€μλλ‘ μν κ²μ
const searchResult = await client.searchProducts('μμ΄ν°', {
limit: 10,
imageSize: '230x230',
});
if (searchResult.rCode === '0') {
const products = searchResult.data?.productData || [];
console.log(Found ${products.length} products);
products.forEach(product => {
console.log(${product.productName} - β©${product.productPrice.toLocaleString()});`
});
}
`typescript
// GoldBox νΉκ° μν μ‘°ν
const goldboxResult = await client.goldbox({
subId: 'my-tracking-id',
imageSize: '300x300',
});
if (goldboxResult.rCode === '0') {
const products = goldboxResult.data || [];
console.log(Found ${products.length} GoldBox products);`
}
`typescript
// CoupangPL μν μ‘°ν
const coupangplResult = await client.coupangPL({
limit: 50,
imageSize: '512x512',
subId: 'my-tracking-id',
});
if (coupangplResult.rCode === '0') {
const products = coupangplResult.data || [];
console.log(Found ${products.length} CoupangPL products);`
}
`typescript
// μΏ ν‘ URLμ ννΈλμ€ μ ν΄ λ§ν¬λ‘ λ³ν
const deeplinkResult = await client.deeplink({
coupangUrls: [
'https://www.coupang.com/vp/products/184614775',
'https://www.coupang.com/vp/products/123456789',
],
subId: 'my-tracking-id', // μ νμ¬ν
});
if (deeplinkResult.rCode === '0') {
const links = deeplinkResult.data || [];
links.forEach(link => {
console.log(Original: ${link.originalUrl});Shortened: ${link.shortenUrl}
console.log();Landing: ${link.landingUrl}
console.log();`
});
}
`typescript`
// ν΄λΌμ΄μΈνΈ μ¬μ΄λ νν°λ§ μ μ©
const filteredResult = await client.goldboxWithFilters(
{
imageSize: '230x230',
},
{
minPrice: 10000, // μ΅μ 1λ§μ
maxPrice: 100000, // μ΅λ 10λ§μ
categories: ['ν¨μ
'], // ν¨μ
μΉ΄ν
κ³ λ¦¬λ§
rocketOnly: true, // λ‘μΌλ°°μ‘λ§
freeShippingOnly: false, // 무λ£λ°°μ‘ 쑰건 μμ
}
);
`typescript`
const client = new CoupangPartnersClient(
{
accessKey: 'your-access-key',
secretKey: 'your-secret-key',
},
{
timeout: 15000, // 15μ΄ νμμμ
debug: true, // λλ²κ·Έ λͺ¨λ νμ±ν
}
);
`typescript
// λ°νμμμ μ€μ λ³κ²½
client.updateConfig({
timeout: 20000,
debug: false,
});
// μ API ν€λ‘ μ
λ°μ΄νΈ
client.updateConfig({
credentials: {
accessKey: 'new-access-key',
secretKey: 'new-secret-key',
},
});
`
SDKμ ν¨κ» μ 곡λλ ν μ€νΈ UIλ₯Ό μ¬μ©νμ¬ μ€μκ°μΌλ‘ APIλ₯Ό ν μ€νΈν μ μμ΅λλ€.
`bashν
μ€νΈ νλ‘μ νΈ ν΄λ‘ λ° μ€μ
git clone https://github.com/mooooburg-dev/coupang-partners-sdk-standalone.git
cd using-cp-sdk-test
ν
μ€νΈ UI κΈ°λ₯:
- 3κ° API ν
μ€νΈ: μνκ²μ, GoldBox, CoupangPL
- μ€μκ° νλΌλ―Έν° μ‘°μ : ν€μλ, κ²°κ³Ό μ, μ΄λ―Έμ§ ν¬κΈ° λ±
- μλ΅ λ°μ΄ν° μκ°ν: μν μΉ΄λ, κ°κ²©, λ°°μ‘ μ΅μ
νμ
- μλ¬ μ²λ¦¬: μμΈν μλ¬ λ©μμ§ λ° μ²λ¦¬ μν
π API λ νΌλ°μ€
$3
#### Constructor
`typescript
new CoupangPartnersClient(credentials, config?)
`Parameters:
-
credentials: CoupangCredentials - API μΈμ¦ μ 보
- config?: Partial - μ΅μ
μ€μ #### Methods
| Method | Description | Parameters | Returns |
| ---------------------- | --------------------------- | ------------------------------------------------- | -------------------------------- |
|
searchProducts() | ν€μλ μν κ²μ | keyword: string, options?: ProductSearchOptions | Promise |
| goldbox() | GoldBox μν μ‘°ν | params?: GoldBoxParams | Promise |
| goldboxWithFilters() | νν°λ§λ GoldBox μ‘°ν | params?: GoldBoxParams, filters?: FilterOptions | Promise |
| coupangPL() | CoupangPL μν μ‘°ν | params?: CoupangPLParams | Promise |
| deeplink() | λ₯λ§ν¬ μμ± (URL λ³ν) | params: DeeplinkParams | Promise |
| generateSignature() | HMAC μλͺ
μμ± | method: string, url: string | string |
| updateConfig() | μ€μ μ
λ°μ΄νΈ | config: Partial | void |
| getConfig() | νμ¬ μ€μ μ‘°ν | - | Omit |
| healthCheck() | ν¬μ€ μ²΄ν¬ | - | boolean |$3
#### Product (κ²μ)
`typescript
interface Product {
keyword: string;
rank: number;
isRocket: boolean;
isFreeShipping: boolean;
productId: number;
productImage: string;
productName: string;
productPrice: number;
productUrl: string;
}
`#### GoldBoxProduct
`typescript
interface GoldBoxProduct {
categoryName: string;
isRocket: boolean;
isFreeShipping: boolean;
productId: number;
productImage: string;
productName: string;
productPrice: number;
productUrl: string;
}
`#### CoupangPLProduct
`typescript
interface CoupangPLProduct {
categoryName: string;
isRocket: boolean;
isFreeShipping: boolean;
productId: number;
productImage: string;
productName: string;
productPrice: number;
productUrl: string;
}
`#### DeeplinkData
`typescript
interface DeeplinkData {
originalUrl: string; // μλ³Έ μΏ ν‘ URL
shortenUrl: string; // λ¨μΆλ μ ν΄ λ§ν¬
landingUrl: string; // λλ© νμ΄μ§ URL
}
`#### DeeplinkParams
`typescript
interface DeeplinkParams {
coupangUrls: string[]; // λ³νν μΏ ν‘ URL λ°°μ΄
subId?: string; // μΆμ μ© μλΈ ID (μ νμ¬ν)
}
`#### API μλ΅ νμ
`typescript
interface ApiResponse {
rCode: string; // "0": μ±κ³΅, κΈ°ν: μλ¬
rMessage: string; // μλ΅ λ©μμ§
data?: Product[]; // μν λ°μ΄ν° (APIλ³λ‘ λ€λ¦)
}
`#### μ€μ μ΅μ
`typescript
interface SDKConfig {
credentials: CoupangCredentials;
timeout?: number; // κΈ°λ³Έκ°: 10000ms
debug?: boolean; // κΈ°λ³Έκ°: false
}interface CoupangCredentials {
accessKey: string;
secretKey: string;
}
`π§ μλ¬ μ²λ¦¬
SDKλ λ€μν μλ¬ μν©μ μλμΌλ‘ μ²λ¦¬ν©λλ€:
`typescript
try {
const result = await client.searchProducts('ν€μλ');
} catch (error) {
if (error.message.includes('401')) {
console.error('μΈμ¦ μ€ν¨: API ν€λ₯Ό νμΈνμΈμ');
} else if (error.message.includes('429')) {
console.error('μμ² νλ μ΄κ³Ό: μ μ ν λ€μ μλνμΈμ');
} else if (error.message.includes('HTML error page')) {
console.error('API μλ² μ€λ₯: μλΉμ€ μ κ² μ€μΌ μ μμ΅λλ€');
} else {
console.error('μ μ μλ μ€λ₯:', error.message);
}
}
`π§ͺ ν
μ€νΈ
`bash
μ 체 ν
μ€νΈ μ€ν
npm testν
μ€νΈ κ°μ λͺ¨λ
npm run test:watch컀λ²λ¦¬μ§ 리ν¬νΈ μμ±
npm run test:coverage
`π μμ μ€ν
`bash
κΈ°λ³Έ μ¬μ© μμ
npm run exampleCoupangPL API ν
μ€νΈ
npx ts-node examples/test-coupangpl.tsGoldBox API ν
μ€νΈ
npx ts-node examples/goldbox-api-test.ts
`π οΈ κ°λ° λͺ
λ Ήμ΄
`bash
κ°λ° λͺ¨λ (watch)
npm run devTypeScript μ»΄νμΌ
npm run buildμ½λ κ²μ¬
npm run lintμ½λ ν¬λ§·ν
npm run formatν¨ν€μ§ μ€λΉ
npm run prepublishOnly
``- Node.js 16+
- TypeScript 4.5+ (κ°λ° μ)
- Coupang Partners API μΈμ¦ ν€
- π§ λ₯λ§ν¬ API μλ΅ νμ
μμ (shortUrl β shortenUrl, landingUrl μΆκ°)
- π README νμ
μ μ λ° μμ μ½λ μ
λ°μ΄νΈ
- π λ₯λ§ν¬ API μλν¬μΈνΈ μμ
- π§ README νμ
μ μ μμ (shortenUrl β shortUrl)
- π README λ₯λ§ν¬ API λ¬Έμ μ λ°μ΄νΈ
- β¨ λ₯λ§ν¬(Deeplink) API μΆκ°
- π λ²κ·Έ μμ λ° μμ μ± κ°μ
- β¨ CoupangPL API μΆκ°
- π‘οΈ ν₯μλ μλ¬ μ²λ¦¬ (HTML μλ΅, JSON νμ± μλ¬)
- π§ͺ ν
μ€νΈ UI μ 곡
- π README μ λ©΄ κ°νΈ
- π μμ νμΌ μΆκ°
- β¨ μν κ²μ API μ§μ
- β¨ GoldBox API μ§μ
- π μμ ν TypeScript μ§μ
- π HMAC SHA256 CEA μΈμ¦
- π λ²κ·Έ 리ν¬νΈ: GitHub Issues
- π‘ κΈ°λ₯ μμ²: GitHub Discussions
- π§ λ¬Έμ: mooooburg.dev@gmail.com
μ΄ νλ‘μ νΈλ MIT λΌμ΄μ μ€ νμ λ°°ν¬λ©λλ€.
---