API Reference

전체 endpoint 카탈로그.

Base URLs

서비스URL
CP-Authhttps://auth.cp-platform.com
CP-Payhttps://pay.cp-platform.com
CP-Notifyhttps://notify.cp-platform.com
CP-Toolshttps://tools.cp-platform.com
CP-API (외부 공개)https://api.cp-platform.com

인증 헤더

헤더사용처
Authorization: Bearer <access_token>사용자 토큰 (또는 HttpOnly 쿠키 access_token)
X-API-Key: <api_key>서비스 간 호출, 외부 개발자
X-API-Key: <admin_key>Admin API

CP-Auth

OAuth

GET/oauth/login
인증
인증 불필요
POST/oauth/authorize
인증
인증 불필요
Rate Limit
150/min
POST/oauth/token
인증
인증 불필요
Rate Limit
300/min
GET/oauth/userinfo
인증
사용자 토큰
GET/oauth/callback
인증
인증 불필요

사용자 인증·관리

POST/auth/login
인증
인증 불필요
Rate Limit
600/min
POST/auth/signup
인증
인증 불필요
Rate Limit
300/min
POST/auth/refresh
인증
인증 불필요
Rate Limit
300/min
POST/auth/logout
인증
사용자 토큰
POST/auth/verify
인증
인증 불필요
Rate Limit
600/min
GET/auth/me
인증
사용자 토큰
Rate Limit
3000/min
POST/auth/oauth/exchange
인증
인증 불필요
Rate Limit
300/min

CP-Pay

단건 결제

POST/payments/direct/checkout
인증
API Key
권한
pay.payments.direct
Rate Limit
600/min
POST/payments/direct/confirm
인증
API Key
권한
pay.payments.direct
Rate Limit
600/min

구독 (외부 서비스용 — api-key)

POST/subscriptions/checkout/external
인증
API Key
권한
pay.subscriptions.checkout
Rate Limit
1800/min
POST/subscriptions/confirm/external
인증
API Key
권한
pay.subscriptions.checkout
Rate Limit
900/min
GET/subscriptions/status/external?user_id={uuid}
인증
API Key
권한
pay.subscriptions.checkout

구독 (CP 사용자 본인 인증)

GET/subscriptions/plans
인증
인증 불필요
POST/subscriptions/checkout/toss
인증
사용자 토큰
Rate Limit
900/min
POST/subscriptions/confirm/toss
인증
사용자 토큰
Rate Limit
900/min
GET/subscriptions/current
인증
사용자 토큰
POST/subscriptions/cancel
인증
사용자 토큰
POST/subscriptions/resume
인증
사용자 토큰

Webhook 관리

PUT/developers/apps/{app_id}/webhook
인증
사용자 토큰
POST/developers/apps/{app_id}/webhook/regenerate-secret
인증
사용자 토큰
GET/developers/apps/{app_id}/webhook/deliveries
인증
사용자 토큰

CP-Notify

POST/notifications/email
인증
API Key
권한
notify.email.send
Rate Limit
200/min
POST/notifications/sms
인증
API Key
권한
notify.sms.send
Rate Limit
3000/min
POST/notifications/kakao
인증
API Key
권한
notify.kakao.send
Rate Limit
3000/min
POST/notifications/push
인증
API Key
권한
notify.push.send
Rate Limit
3000/min
GET/notifications/quotas
인증
API Key
GET/notifications/usage
인증
API Key

SDK — @cp-platform/auth-sdk v0.5.2

npm i git+https://github.com/Copark-Dev/cp-auth-sdk.git#v0.5.2

타입 정의는 SDK 안에 동봉되어 있어 별도 import 불필요.

Frontend — CpAuthClient

import { CpAuthClient } from "@cp-platform/auth-sdk";
 
const auth = new CpAuthClient({
  authUrl: "https://auth.cp-platform.com",
  productOrigin: "https://your-app.com",
  // storage: "localStorage" | "memory" | TokenStorage
});
 
const oauth = await auth.startOAuth("google");
if (!oauth.blocked && "url" in oauth) window.location.assign(oauth.url);
 
const signup = await auth.signup({ email, password, phone, phone_consent: true });
// signup.status: "authenticated" | "verification_required"
await auth.login(email, password);
await auth.requestPasswordReset(email);
await auth.confirmPasswordReset(token, newPassword);
await auth.verifyEmail(token);
 
const user = await auth.getMe();
const accessToken = await auth.ensureAccessToken();
auth.isLoggedIn();
await auth.logout();

React — CpAuthProvider / useCpAuth

<CpAuthProvider strict>...</CpAuthProvider>
 
const { guardOAuth } = useCpAuth();
guardOAuth(provider): "proceed" | "redirected" | "blocked";

strict 옵션 ON 시 Safari / Chrome / Samsung / Firefox / Edge / Opera / Brave / DuckDuckGo whitelist 외 mobile UA를 in-app으로 처리.

Backend — verifyCpJwt / CpServerClient

import { verifyCpJwt } from "@cp-platform/auth-sdk/jwt";
import { CpServerClient } from "@cp-platform/auth-sdk/server";
 
const { cpUserId, email } = await verifyCpJwt(bearerToken);
// Supabase JWKS 자동 캐시 (ES256)
 
const cp = new CpServerClient(); // authUrl 기본값 https://auth.cp-platform.com
const tokens = await cp.exchangeOAuthCode(code, codeVerifier);
const user = await cp.getUserInfo(tokens.access_token);

In-app browser helpers

import { detectInAppBrowser, buildChromeIntentUrl } from "@cp-platform/auth-sdk";
 
const info = detectInAppBrowser(navigator.userAgent, { strict: true });
// { isInApp, appName, isAndroid, isIOS, unknownInApp }
 
const intent = buildChromeIntentUrl("https://your-app.com/login");
// intent://... — Android 에서 Chrome 으로 link escape

지원 패턴 (30+ 명명 앱 + WebView fallback): Meta · WeChat · X · TikTok · Snapchat · Pinterest · Reddit · Discord · Telegram · Slack / KakaoTalk · KakaoStory · Naver · Daum · LINE · BAND · EveryTime · Blind / KakaoBank · KakaoPay · Toss · KB · Woori · Shinhan · Hana · NH · IBK / Coupang · Baemin · Karrot · 11st · SSG · Emart · Lotte · Gmarket.