API Reference
Full endpoint catalog.
Base URLs
| Service | URL |
|---|---|
| CP-Auth | https://auth.cp-platform.com |
| CP-Pay | https://pay.cp-platform.com |
| CP-Notify | https://notify.cp-platform.com |
| CP-Tools | https://tools.cp-platform.com |
| CP-API (external public) | https://api.cp-platform.com |
Authentication headers
| Header | Used by |
|---|---|
Authorization: Bearer <access_token> | User token (or the HttpOnly access_token cookie) |
X-API-Key: <api_key> | Service-to-service calls, external developers |
X-API-Key: <admin_key> | Admin API |
CP-Auth
OAuth
GET
/oauth/loginPOST
/oauth/authorizePOST
/oauth/tokenGET
/oauth/userinfoGET
/oauth/callbackUser auth & profile
POST
/auth/loginPOST
/auth/signupPOST
/auth/refreshPOST
/auth/logoutPOST
/auth/verifyGET
/auth/mePOST
/auth/oauth/exchangeCP-Pay
One-off payments
POST
/payments/direct/checkoutPOST
/payments/direct/confirmSubscriptions (external services — api-key)
POST
/subscriptions/checkout/externalPOST
/subscriptions/confirm/externalGET
/subscriptions/status/external?user_id={uuid}Subscriptions (CP user-authenticated)
GET
/subscriptions/plansPOST
/subscriptions/checkout/tossPOST
/subscriptions/confirm/tossGET
/subscriptions/currentPOST
/subscriptions/cancelPOST
/subscriptions/resumeWebhook management
PUT
/developers/apps/{app_id}/webhookPOST
/developers/apps/{app_id}/webhook/regenerate-secretGET
/developers/apps/{app_id}/webhook/deliveriesCP-Notify
POST
/notifications/emailPOST
/notifications/smsPOST
/notifications/kakaoPOST
/notifications/pushGET
/notifications/quotasGET
/notifications/usageSDK — @cp-platform/auth-sdk v0.5.2
npm i git+https://github.com/Copark-Dev/cp-auth-sdk.git#v0.5.2Types ship with the SDK — no separate .d.ts download.
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";With strict on, mobile UAs outside the Safari/Chrome/Samsung/Firefox/Edge/Opera/Brave/DuckDuckGo whitelist are treated as 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);
// Auto Supabase JWKS cache (ES256)
const cp = new CpServerClient(); // authUrl defaults to 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 escapePatterns covered (30+ named apps + 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.