Diffsome diffsome
Sign up

AI Prompt Collection AI ํ”„๋กฌํ”„ํŠธ ๋ชจ์Œ

Copy & paste prompts for your AI coding tool AI ์ฝ”๋”ฉ ๋„๊ตฌ์— ๋ณต์‚ฌํ•ด์„œ ๋ฐ”๋กœ ์‚ฌ์šฉํ•˜์„ธ์š”

Lovable Bolt.new v0.dev Replit Agent Firebase Studio

Why SDK? SDK๋ฅผ ์ถ”์ฒœํ•˜๋Š” ์ด์œ 

  • TypeScript support with full type safetyTypeScript ํƒ€์ž… ์ง€์›์œผ๋กœ ์•ˆ์ „ํ•œ ๊ฐœ๋ฐœ
  • Simpler code, less boilerplate๊ฐ„๊ฒฐํ•œ ์ฝ”๋“œ, ์ ์€ ๋ณด์ผ๋Ÿฌํ”Œ๋ ˆ์ดํŠธ
  • Built-in auth token management์ธ์ฆ ํ† ํฐ ์ž๋™ ๊ด€๋ฆฌ
SETUP

Initial Setup ์ดˆ๊ธฐ ์„ค์ •

Install the Diffsome SDK and set up the client.

npm install @diffsome/sdk

Create src/lib/diffsome.ts:

import { Diffsome } from '@diffsome/sdk';

export const diffsome = new Diffsome({
  baseUrl: 'https://www.diffsome.com',
  tenantId: 'YOUR_TENANT_ID',
  apiKey: 'YOUR_API_KEY',
  persistToken: true,
});

Replace YOUR_TENANT_ID and YOUR_API_KEY with your actual values from the dashboard.Diffsome SDK๋ฅผ ์„ค์น˜ํ•˜๊ณ  ํด๋ผ์ด์–ธํŠธ๋ฅผ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.

npm install @diffsome/sdk

src/lib/diffsome.ts ํŒŒ์ผ์„ ์ƒ์„ฑํ•˜์„ธ์š”:

import { Diffsome } from '@diffsome/sdk';

export const diffsome = new Diffsome({
  baseUrl: 'https://www.diffsome.com',
  tenantId: 'YOUR_TENANT_ID',
  apiKey: 'YOUR_API_KEY',
  persistToken: true,
});

YOUR_TENANT_ID์™€ YOUR_API_KEY๋Š” ๋Œ€์‹œ๋ณด๋“œ์—์„œ ํ™•์ธํ•œ ์‹ค์ œ ๊ฐ’์œผ๋กœ ๊ต์ฒดํ•˜์„ธ์š”.
AUTH

Login & Register ๋กœ๊ทธ์ธ & ํšŒ์›๊ฐ€์ž…

Create login and register pages using the Diffsome SDK.

Login:
const { token, user } = await diffsome.auth.login({ email, password });

Register:
const { token, user } = await diffsome.auth.register({ name, email, password, password_confirmation: password });

Logout:
await diffsome.auth.logout();

Check auth state:
const user = await diffsome.auth.me();

Use persistToken: true in SDK config for automatic token management.Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋กœ๊ทธ์ธ, ํšŒ์›๊ฐ€์ž… ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

๋กœ๊ทธ์ธ:
const { token, user } = await diffsome.auth.login({ email, password });

ํšŒ์›๊ฐ€์ž…:
const { token, user } = await diffsome.auth.register({ name, email, password, password_confirmation: password });

๋กœ๊ทธ์•„์›ƒ:
await diffsome.auth.logout();

๋กœ๊ทธ์ธ ์ƒํƒœ ํ™•์ธ:
const user = await diffsome.auth.me();

SDK ์„ค์ •์—์„œ persistToken: true๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ํ† ํฐ์ด ์ž๋™ ๊ด€๋ฆฌ๋ฉ๋‹ˆ๋‹ค.
BLOG

Blog List & Detail ๋ธ”๋กœ๊ทธ ๋ชฉ๋ก & ์ƒ์„ธ

Create blog list and detail pages using Diffsome SDK.

List posts:
const { data: posts, meta } = await diffsome.blog.list({ page: 1, per_page: 10 });

Get single post:
const post = await diffsome.blog.get(slug);

Get categories:
const categories = await diffsome.blog.categories();

Filter by category:
const { data: posts } = await diffsome.blog.byCategory('tech');Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋ธ”๋กœ๊ทธ ๋ชฉ๋ก, ์ƒ์„ธ ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

๊ธ€ ๋ชฉ๋ก:
const { data: posts, meta } = await diffsome.blog.list({ page: 1, per_page: 10 });

๊ธ€ ์ƒ์„ธ:
const post = await diffsome.blog.get(slug);

์นดํ…Œ๊ณ ๋ฆฌ ๋ชฉ๋ก:
const categories = await diffsome.blog.categories();

์นดํ…Œ๊ณ ๋ฆฌ๋ณ„ ํ•„ํ„ฐ:
const { data: posts } = await diffsome.blog.byCategory('tech');
SHOP

Products & Categories ์ƒํ’ˆ & ์นดํ…Œ๊ณ ๋ฆฌ

Create product list and detail pages using Diffsome SDK.

Product List:
const { data: products, meta } = await diffsome.shop.listProducts({ page: 1, per_page: 12 });

Product Detail:
const product = await diffsome.shop.getProduct(slug);

Featured Products:
const featured = await diffsome.shop.featuredProducts(8);

Search Products:
const { data: results } = await diffsome.shop.searchProducts('keyword');

Categories:
const { data: categories } = await diffsome.shop.listCategories();
const category = await diffsome.shop.getCategory(slug);
const { data: products } = await diffsome.shop.categoryProducts(categorySlug);Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ƒํ’ˆ ๋ชฉ๋ก, ์ƒ์„ธ ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

์ƒํ’ˆ ๋ชฉ๋ก:
const { data: products, meta } = await diffsome.shop.listProducts({ page: 1, per_page: 12 });

์ƒํ’ˆ ์ƒ์„ธ:
const product = await diffsome.shop.getProduct(slug);

์ถ”์ฒœ ์ƒํ’ˆ:
const featured = await diffsome.shop.featuredProducts(8);

์ƒํ’ˆ ๊ฒ€์ƒ‰:
const { data: results } = await diffsome.shop.searchProducts('keyword');

์นดํ…Œ๊ณ ๋ฆฌ:
const { data: categories } = await diffsome.shop.listCategories();
const category = await diffsome.shop.getCategory(slug);
const { data: products } = await diffsome.shop.categoryProducts(categorySlug);
SHOP

Cart ์žฅ๋ฐ”๊ตฌ๋‹ˆ

Create cart page using Diffsome SDK.

Get Cart:
const cart = await diffsome.shop.getCart();
// cart.items, cart.total, cart.item_count

Add to Cart:
await diffsome.shop.addToCart({ product_id: 1, quantity: 1, variant_id: optionalVariantId });

Update Quantity:
await diffsome.shop.updateCartItem(itemId, { quantity: 2 });

Remove Item:
await diffsome.shop.removeFromCart(itemId);

Clear Cart:
await diffsome.shop.clearCart();

Note: Guest cart is automatically persisted via session_id.Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์žฅ๋ฐ”๊ตฌ๋‹ˆ ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

์žฅ๋ฐ”๊ตฌ๋‹ˆ ์กฐํšŒ:
const cart = await diffsome.shop.getCart();
// cart.items, cart.total, cart.item_count

์žฅ๋ฐ”๊ตฌ๋‹ˆ ์ถ”๊ฐ€:
await diffsome.shop.addToCart({ product_id: 1, quantity: 1, variant_id: optionalVariantId });

์ˆ˜๋Ÿ‰ ๋ณ€๊ฒฝ:
await diffsome.shop.updateCartItem(itemId, { quantity: 2 });

ํ•ญ๋ชฉ ์‚ญ์ œ:
await diffsome.shop.removeFromCart(itemId);

์žฅ๋ฐ”๊ตฌ๋‹ˆ ๋น„์šฐ๊ธฐ:
await diffsome.shop.clearCart();

์ฐธ๊ณ : ๋น„ํšŒ์› ์žฅ๋ฐ”๊ตฌ๋‹ˆ๋Š” session_id๋กœ ์ž๋™ ์œ ์ง€๋ฉ๋‹ˆ๋‹ค.
SHOP

Orders & Checkout ์ฃผ๋ฌธ & ๊ฒฐ์ œ

Create checkout and order pages using Diffsome SDK.

Create Order:
const order = await diffsome.shop.createOrder({
  shipping_name: 'John Doe',
  shipping_phone: '010-1234-5678',
  shipping_address: '123 Main St',
  shipping_address_detail: 'Apt 101',
  shipping_postal_code: '12345',
  payment_method: 'card', // card, bank_transfer, virtual_account
  note: 'Please leave at door'
});

My Orders:
const { data: orders, meta } = await diffsome.shop.listOrders({ page: 1 });

Order Detail:
const order = await diffsome.shop.getOrder(orderNumber);

Cancel Order:
await diffsome.shop.cancelOrder(orderId);Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ฃผ๋ฌธ/๊ฒฐ์ œ ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

์ฃผ๋ฌธ ์ƒ์„ฑ:
const order = await diffsome.shop.createOrder({
  shipping_name: 'ํ™๊ธธ๋™',
  shipping_phone: '010-1234-5678',
  shipping_address: '์„œ์šธ์‹œ ๊ฐ•๋‚จ๊ตฌ ํ…Œํ—ค๋ž€๋กœ 123',
  shipping_address_detail: '101ํ˜ธ',
  shipping_postal_code: '12345',
  payment_method: 'card', // card, bank_transfer, virtual_account
  note: '๋ฌธ ์•ž์— ๋†“์•„์ฃผ์„ธ์š”'
});

๋‚ด ์ฃผ๋ฌธ ๋ชฉ๋ก:
const { data: orders, meta } = await diffsome.shop.listOrders({ page: 1 });

์ฃผ๋ฌธ ์ƒ์„ธ:
const order = await diffsome.shop.getOrder(orderNumber);

์ฃผ๋ฌธ ์ทจ์†Œ:
await diffsome.shop.cancelOrder(orderId);
SHOP

Payment Integration ๊ฒฐ์ œ ์—ฐ๋™

Integrate payments using Diffsome SDK.

Check Payment Status:
const status = await diffsome.shop.getPaymentStatus();
// { toss_enabled, stripe_enabled }

Toss Payments (Korea):
const ready = await diffsome.shop.tossPaymentReady({ order_number: 'ORD-123' });
// Use ready.client_key with Toss SDK
const result = await diffsome.shop.tossPaymentConfirm({ paymentKey, orderId, amount });

Stripe (Global):
const { checkout_url } = await diffsome.shop.stripeCheckout({
  order_number: 'ORD-123',
  success_url: 'https://yoursite.com/success',
  cancel_url: 'https://yoursite.com/cancel'
});
window.location.href = checkout_url;
// After redirect:
const result = await diffsome.shop.stripeVerify({ session_id });Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๊ฒฐ์ œ๋ฅผ ์—ฐ๋™ํ•˜์„ธ์š”.

๊ฒฐ์ œ ์ƒํƒœ ํ™•์ธ:
const status = await diffsome.shop.getPaymentStatus();
// { toss_enabled, stripe_enabled }

ํ† ์Šค ํŽ˜์ด๋จผ์ธ  (ํ•œ๊ตญ):
const ready = await diffsome.shop.tossPaymentReady({ order_number: 'ORD-123' });
// ready.client_key๋ฅผ ํ† ์Šค SDK์™€ ํ•จ๊ป˜ ์‚ฌ์šฉ
const result = await diffsome.shop.tossPaymentConfirm({ paymentKey, orderId, amount });

Stripe (ํ•ด์™ธ):
const { checkout_url } = await diffsome.shop.stripeCheckout({
  order_number: 'ORD-123',
  success_url: 'https://yoursite.com/success',
  cancel_url: 'https://yoursite.com/cancel'
});
window.location.href = checkout_url;
// ๋ฆฌ๋‹ค์ด๋ ‰ํŠธ ํ›„:
const result = await diffsome.shop.stripeVerify({ session_id });
SHOP

Product Reviews ์ƒํ’ˆ ๋ฆฌ๋ทฐ

Create product review system using Diffsome SDK.

Get Reviews:
const { data: reviews, stats } = await diffsome.shop.getProductReviews(productSlug, { rating: 5, sort: 'latest' });
// stats: { average_rating, total_count, rating_counts }

Check if Can Review:
const { can_review, reason } = await diffsome.shop.canReviewProduct(productSlug);
// Requires: logged in + purchased + not reviewed yet

Create Review:
const review = await diffsome.shop.createReview(productSlug, {
  rating: 5,
  title: 'Great product!',
  content: 'Highly recommended...',
  images: [mediaId1, mediaId2] // optional
});

Mark Helpful:
await diffsome.shop.markReviewHelpful(reviewId);

My Reviews:
const { data: myReviews } = await diffsome.shop.myReviews();Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ƒํ’ˆ ๋ฆฌ๋ทฐ ์‹œ์Šคํ…œ์„ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

๋ฆฌ๋ทฐ ์กฐํšŒ:
const { data: reviews, stats } = await diffsome.shop.getProductReviews(productSlug, { rating: 5, sort: 'latest' });
// stats: { average_rating, total_count, rating_counts }

๋ฆฌ๋ทฐ ์ž‘์„ฑ ๊ฐ€๋Šฅ ์—ฌ๋ถ€:
const { can_review, reason } = await diffsome.shop.canReviewProduct(productSlug);
// ์กฐ๊ฑด: ๋กœ๊ทธ์ธ + ๊ตฌ๋งค ์™„๋ฃŒ + ๋ฏธ์ž‘์„ฑ

๋ฆฌ๋ทฐ ์ž‘์„ฑ:
const review = await diffsome.shop.createReview(productSlug, {
  rating: 5,
  title: '์ •๋ง ์ข‹์•„์š”!',
  content: '๊ฐ•๋ ฅ ์ถ”์ฒœํ•ฉ๋‹ˆ๋‹ค...',
  images: [mediaId1, mediaId2] // ์„ ํƒ
});

๋„์›€๋จ ํ‘œ์‹œ:
await diffsome.shop.markReviewHelpful(reviewId);

๋‚ด ๋ฆฌ๋ทฐ ๋ชฉ๋ก:
const { data: myReviews } = await diffsome.shop.myReviews();
SHOP

Coupons ์ฟ ํฐ

Create coupon system using Diffsome SDK.

My Coupons:
const coupons = await diffsome.shop.myCoupons();

Validate Coupon:
const validation = await diffsome.shop.validateCoupon(couponCode, orderAmount);
// { valid, discount_amount, message }

Apply coupon during checkout by passing coupon_code to createOrder.Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ฟ ํฐ ์‹œ์Šคํ…œ์„ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

๋‚ด ์ฟ ํฐ ๋ชฉ๋ก:
const coupons = await diffsome.shop.myCoupons();

์ฟ ํฐ ๊ฒ€์ฆ:
const validation = await diffsome.shop.validateCoupon(couponCode, orderAmount);
// { valid, discount_amount, message }

์ฃผ๋ฌธ ์‹œ coupon_code๋ฅผ createOrder์— ์ „๋‹ฌํ•˜์—ฌ ์ฟ ํฐ์„ ์ ์šฉํ•ฉ๋‹ˆ๋‹ค.
BOARD

Board & Posts ๊ฒŒ์‹œํŒ & ๊ฒŒ์‹œ๊ธ€

Create board pages using Diffsome SDK.

Boards:
const { data: boards } = await diffsome.boards.list();
const board = await diffsome.boards.get(slug);

Posts:
const { data: posts } = await diffsome.boards.listPosts(boardSlug);
const post = await diffsome.boards.getPost(postId);
await diffsome.boards.createPost({ board_id, title, content });

Comments:
const comments = await diffsome.boards.listComments(postId);
await diffsome.boards.createComment(postId, { content });Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๊ฒŒ์‹œํŒ ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

๊ฒŒ์‹œํŒ:
const { data: boards } = await diffsome.boards.list();
const board = await diffsome.boards.get(slug);

๊ฒŒ์‹œ๊ธ€:
const { data: posts } = await diffsome.boards.listPosts(boardSlug);
const post = await diffsome.boards.getPost(postId);
await diffsome.boards.createPost({ board_id, title, content });

๋Œ“๊ธ€:
const comments = await diffsome.boards.listComments(postId);
await diffsome.boards.createComment(postId, { content });
RESERVATION

Reservation System ์˜ˆ์•ฝ ์‹œ์Šคํ…œ

Create reservation pages using Diffsome SDK.

Settings & Services:
const settings = await diffsome.reservation.getSettings();
const services = await diffsome.reservation.listServices();
const staffs = await diffsome.reservation.listStaff(serviceId); // optional filter

Available Slots:
const dates = await diffsome.reservation.getAvailableDates({ service_id, month: '2025-01' });
const slots = await diffsome.reservation.getAvailableSlots({ service_id, date: '2025-01-15', staff_id });

Create Reservation:
const result = await diffsome.reservation.create({
  service_id, staff_id, date, start_time,
  customer_name, customer_email, customer_phone, note
});

My Reservations:
const { data: reservations } = await diffsome.reservation.list();
const upcoming = await diffsome.reservation.upcoming(10);
const past = await diffsome.reservation.past(10);
const detail = await diffsome.reservation.get(reservationNumber);

Cancel:
await diffsome.reservation.cancel(reservationNumber, 'reason');Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์˜ˆ์•ฝ ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

์„ค์ • & ์„œ๋น„์Šค:
const settings = await diffsome.reservation.getSettings();
const services = await diffsome.reservation.listServices();
const staffs = await diffsome.reservation.listStaff(serviceId); // ์„ ํƒ์  ํ•„ํ„ฐ

์˜ˆ์•ฝ ๊ฐ€๋Šฅ ์‹œ๊ฐ„:
const dates = await diffsome.reservation.getAvailableDates({ service_id, month: '2025-01' });
const slots = await diffsome.reservation.getAvailableSlots({ service_id, date: '2025-01-15', staff_id });

์˜ˆ์•ฝ ์ƒ์„ฑ:
const result = await diffsome.reservation.create({
  service_id, staff_id, date, start_time,
  customer_name, customer_email, customer_phone, note
});

๋‚ด ์˜ˆ์•ฝ:
const { data: reservations } = await diffsome.reservation.list();
const upcoming = await diffsome.reservation.upcoming(10);
const past = await diffsome.reservation.past(10);
const detail = await diffsome.reservation.get(reservationNumber);

์ทจ์†Œ:
await diffsome.reservation.cancel(reservationNumber, '์ทจ์†Œ ์‚ฌ์œ ');
FORMS

Dynamic Forms ๋™์  ํผ

Create form pages using Diffsome SDK.

List Forms:
const { data: forms } = await diffsome.forms.list();

Get Form (with fields schema):
const form = await diffsome.forms.get(formSlug);
// form.fields: [{ name, label, type, required, options }]

Submit Form:
const submission = await diffsome.forms.submit(formSlug, {
  name: 'John',
  email: '[email protected]',
  message: 'Hello...'
});

My Submissions:
const { data: submissions } = await diffsome.forms.mySubmissions();
const submission = await diffsome.forms.getSubmission(submissionId);Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํผ ํŽ˜์ด์ง€๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

ํผ ๋ชฉ๋ก:
const { data: forms } = await diffsome.forms.list();

ํผ ์กฐํšŒ (ํ•„๋“œ ์Šคํ‚ค๋งˆ ํฌํ•จ):
const form = await diffsome.forms.get(formSlug);
// form.fields: [{ name, label, type, required, options }]

ํผ ์ œ์ถœ:
const submission = await diffsome.forms.submit(formSlug, {
  name: 'ํ™๊ธธ๋™',
  email: '[email protected]',
  message: '์•ˆ๋…•ํ•˜์„ธ์š”...'
});

๋‚ด ์ œ์ถœ ๋‚ด์—ญ:
const { data: submissions } = await diffsome.forms.mySubmissions();
const submission = await diffsome.forms.getSubmission(submissionId);
COMMENTS

Comment System ๋Œ“๊ธ€ ์‹œ์Šคํ…œ

Create comment system using Diffsome SDK.

Blog Post Comments:
const comments = await diffsome.comments.blogPost(slug);
await diffsome.comments.createBlogPost(slug, { content, author_name, author_email });

Board Post Comments:
const comments = await diffsome.comments.boardPost(postId);
await diffsome.comments.createBoardPost(postId, { content });

Standalone Comments (Guestbook, Feedback):
const comments = await diffsome.comments.standalone('guestbook');
await diffsome.comments.createStandalone('guestbook', { content, author_name });

Common Actions:
await diffsome.comments.update(commentId, { content });
await diffsome.comments.delete(commentId);
await diffsome.comments.like(commentId);Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๋Œ“๊ธ€ ์‹œ์Šคํ…œ์„ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

๋ธ”๋กœ๊ทธ ๋Œ“๊ธ€:
const comments = await diffsome.comments.blogPost(slug);
await diffsome.comments.createBlogPost(slug, { content, author_name, author_email });

๊ฒŒ์‹œํŒ ๋Œ“๊ธ€:
const comments = await diffsome.comments.boardPost(postId);
await diffsome.comments.createBoardPost(postId, { content });

๋‹จ๋… ๋Œ“๊ธ€ (๋ฐฉ๋ช…๋ก, ํ”ผ๋“œ๋ฐฑ):
const comments = await diffsome.comments.standalone('guestbook');
await diffsome.comments.createStandalone('guestbook', { content, author_name });

๊ณตํ†ต ๊ธฐ๋Šฅ:
await diffsome.comments.update(commentId, { content });
await diffsome.comments.delete(commentId);
await diffsome.comments.like(commentId);
ENTITIES

Custom Entities ์ปค์Šคํ…€ ์—”ํ‹ฐํ‹ฐ

Create custom data management using Diffsome SDK.

Entity Definitions:
const entities = await diffsome.entities.list();
const entity = await diffsome.entities.get('customers');

Records CRUD:
const { data: records, meta } = await diffsome.entities.listRecords('customers', { page: 1, search: 'ACME' });
const record = await diffsome.entities.getRecord('customers', recordId);
const newRecord = await diffsome.entities.createRecord('customers', { company: 'ABC', email: '[email protected]' });
await diffsome.entities.updateRecord('customers', recordId, { company: 'XYZ' });
await diffsome.entities.deleteRecord('customers', recordId);

Typed Access (TypeScript):
interface Customer { company: string; email: string; }
const customers = diffsome.entities.typed('customers');
const { data } = await customers.list();
const record = await customers.get(1); // record.data.company is typedDiffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ์ปค์Šคํ…€ ๋ฐ์ดํ„ฐ ๊ด€๋ฆฌ๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

์—”ํ‹ฐํ‹ฐ ์ •์˜:
const entities = await diffsome.entities.list();
const entity = await diffsome.entities.get('customers');

๋ ˆ์ฝ”๋“œ CRUD:
const { data: records, meta } = await diffsome.entities.listRecords('customers', { page: 1, search: 'ACME' });
const record = await diffsome.entities.getRecord('customers', recordId);
const newRecord = await diffsome.entities.createRecord('customers', { company: 'ABC', email: '[email protected]' });
await diffsome.entities.updateRecord('customers', recordId, { company: 'XYZ' });
await diffsome.entities.deleteRecord('customers', recordId);

ํƒ€์ž… ์ง€์ • ์ ‘๊ทผ (TypeScript):
interface Customer { company: string; email: string; }
const customers = diffsome.entities.typed('customers');
const { data } = await customers.list();
const record = await customers.get(1); // record.data.company์— ํƒ€์ž… ์ ์šฉ
MEDIA

File Upload ํŒŒ์ผ ์—…๋กœ๋“œ

Create file upload using Diffsome SDK.

Upload Single File:
const media = await diffsome.media.upload(file); // File or Blob
// media.id, media.url, media.thumbnail_url

Upload Multiple Files:
const mediaList = await diffsome.media.uploadMultiple([file1, file2]);

List My Media:
const { data: files } = await diffsome.media.list({ type: 'image' });

Get & Delete:
const media = await diffsome.media.get(mediaId);
await diffsome.media.delete(mediaId);

Use with Reviews/Posts:
const media = await diffsome.media.upload(imageFile);
await diffsome.shop.createReview(slug, { rating: 5, content: '...', images: [media.id] });Diffsome SDK๋ฅผ ์‚ฌ์šฉํ•ด์„œ ํŒŒ์ผ ์—…๋กœ๋“œ๋ฅผ ๋งŒ๋“ค์–ด์ฃผ์„ธ์š”.

๋‹จ์ผ ํŒŒ์ผ ์—…๋กœ๋“œ:
const media = await diffsome.media.upload(file); // File ๋˜๋Š” Blob
// media.id, media.url, media.thumbnail_url

๋‹ค์ค‘ ํŒŒ์ผ ์—…๋กœ๋“œ:
const mediaList = await diffsome.media.uploadMultiple([file1, file2]);

๋‚ด ๋ฏธ๋””์–ด ๋ชฉ๋ก:
const { data: files } = await diffsome.media.list({ type: 'image' });

์กฐํšŒ & ์‚ญ์ œ:
const media = await diffsome.media.get(mediaId);
await diffsome.media.delete(mediaId);

๋ฆฌ๋ทฐ/๊ฒŒ์‹œ๊ธ€๊ณผ ํ•จ๊ป˜ ์‚ฌ์šฉ:
const media = await diffsome.media.upload(imageFile);
await diffsome.shop.createReview(slug, { rating: 5, content: '...', images: [media.id] });

For Cursor, Claude Code, Windsurf Cursor, Claude Code, Windsurf ์‚ฌ์šฉ์ž

Use the React Starter Kit for the fastest setup. Clone the repo and start building with AI. ๊ฐ€์žฅ ๋น ๋ฅธ ์‹œ์ž‘์„ ์œ„ํ•ด React ์Šคํƒ€ํ„ฐ ํ‚ท์„ ์‚ฌ์šฉํ•˜์„ธ์š”. ์ €์žฅ์†Œ๋ฅผ ํด๋ก ํ•˜๊ณ  AI์™€ ํ•จ๊ป˜ ๊ฐœ๋ฐœ์„ ์‹œ์ž‘ํ•˜์„ธ์š”.

React Starter Kit

RECOMMENDED

React 18 + Vite + TypeScript + Tailwind + shadcn/ui + @diffsome/sdk

Quick Start ๋น ๋ฅธ ์‹œ์ž‘

git clone https://github.com/diffsome/diffsome-demo.git
cd diffsome-demo
npm install
# Edit src/lib/diffsome.ts with your credentials
npm run dev
CONTEXT

AI Context File AI ์ปจํ…์ŠคํŠธ ํŒŒ์ผ

Create a .cursorrules or CLAUDE.md file with this content for AI context:

# Project: Diffsome Frontend

## Tech Stack
- React 18 + Vite + TypeScript
- @diffsome/sdk for API calls
- Tailwind CSS + shadcn/ui

## SDK Usage
import { diffsome } from '@/lib/diffsome';

// Auth
await diffsome.auth.login({ email, password });
await diffsome.auth.register({ name, email, password, password_confirmation });

// Blog
const { data: posts } = await diffsome.blog.list();
const post = await diffsome.blog.get(slug);

// Shop
const { data: products } = await diffsome.shop.listProducts();
const cart = await diffsome.shop.getCart();

## Rules
- Always use SDK methods, not raw fetch
- Handle loading and error states
- Use TypeScript types from SDK.cursorrules ๋˜๋Š” CLAUDE.md ํŒŒ์ผ์„ ๋งŒ๋“ค์–ด AI ์ปจํ…์ŠคํŠธ๋กœ ์‚ฌ์šฉํ•˜์„ธ์š”:

# ํ”„๋กœ์ ํŠธ: Diffsome ํ”„๋ก ํŠธ์—”๋“œ

## ๊ธฐ์ˆ  ์Šคํƒ
- React 18 + Vite + TypeScript
- @diffsome/sdk๋กœ API ํ˜ธ์ถœ
- Tailwind CSS + shadcn/ui

## SDK ์‚ฌ์šฉ๋ฒ•
import { diffsome } from '@/lib/diffsome';

// ์ธ์ฆ
await diffsome.auth.login({ email, password });
await diffsome.auth.register({ name, email, password, password_confirmation });

// ๋ธ”๋กœ๊ทธ
const { data: posts } = await diffsome.blog.list();
const post = await diffsome.blog.get(slug);

// ์‡ผํ•‘๋ชฐ
const { data: products } = await diffsome.shop.listProducts();
const cart = await diffsome.shop.getCart();

## ๊ทœ์น™
- ํ•ญ์ƒ SDK ๋ฉ”์„œ๋“œ ์‚ฌ์šฉ, fetch ์ง์ ‘ ์‚ฌ์šฉ ๊ธˆ์ง€
- ๋กœ๋”ฉ, ์—๋Ÿฌ ์ƒํƒœ ์ฒ˜๋ฆฌ ํ•„์ˆ˜
- SDK์˜ TypeScript ํƒ€์ž… ํ™œ์šฉ
TEMPLATE

Feature Request Template ๊ธฐ๋Šฅ ์š”์ฒญ ํ…œํ”Œ๋ฆฟ

Use this template when asking AI to add features:

Add [FEATURE NAME] page.

Requirements:
- Use @diffsome/sdk from src/lib/diffsome.ts
- Follow existing component patterns in src/components
- Add route in src/App.tsx
- Handle loading and error states
- Use shadcn/ui components

SDK methods to use:
[paste relevant SDK methods here]AI์—๊ฒŒ ๊ธฐ๋Šฅ ์ถ”๊ฐ€๋ฅผ ์š”์ฒญํ•  ๋•Œ ์ด ํ…œํ”Œ๋ฆฟ์„ ์‚ฌ์šฉํ•˜์„ธ์š”:

[๊ธฐ๋Šฅ๋ช…] ํŽ˜์ด์ง€๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.

์š”๊ตฌ์‚ฌํ•ญ:
- src/lib/diffsome.ts์˜ @diffsome/sdk ์‚ฌ์šฉ
- src/components์˜ ๊ธฐ์กด ์ปดํฌ๋„ŒํŠธ ํŒจํ„ด ๋”ฐ๋ฅด๊ธฐ
- src/App.tsx์— ๋ผ์šฐํŠธ ์ถ”๊ฐ€
- ๋กœ๋”ฉ, ์—๋Ÿฌ ์ƒํƒœ ์ฒ˜๋ฆฌ
- shadcn/ui ์ปดํฌ๋„ŒํŠธ ์‚ฌ์šฉ

์‚ฌ์šฉํ•  SDK ๋ฉ”์„œ๋“œ:
[๊ด€๋ จ SDK ๋ฉ”์„œ๋“œ ์—ฌ๊ธฐ์— ๋ถ™์—ฌ๋„ฃ๊ธฐ]