Skip to content
smallPict

샌드박스 모드 테스트 가이드

sp_test_ 논리적 테스트 키를 활용한 쿼터 차감 없는 개발 환경 및 에러 시뮬레이션.

SmallPict에는 로컬 개발, CI/CD 자동화 테스트 및 스테이징 환경을 위해 설계된 논리적 샌드박스 격리 환경이 내장되어 있습니다.

샌드박스 모드를 사용하면 유료 월간 쿼터를 전혀 소모하지 않고, 운영 자산에 영향을 주지 않으면서 이미지 최적화 API를 자유롭게 테스트할 수 있습니다.


샌드박스 API 키 발급 방법

  1. SmallPict 대시보드 → API Keys로 이동합니다.
  2. Create Sandbox Key 버튼을 클릭합니다.
  3. sp_test_... 접두사를 가진 전용 키가 생성됩니다 (예: sp_test_9a8b7c6d5e4f...).
  4. 함께 생성된 Secret Key를 안전한 곳에 보관합니다.

샌드박스 시스템 아키텍처 보호 장치

sp_test_... 키로 API를 호출하면 게이트웨이가 다음과 같이 동작합니다:

End-to-End Image Processing & Edge CDN Flow

Sub-50ms image optimization lifecycle from client upload to global edge delivery.

  1. 01

    Client Application

    WordPress / SDK / API

    Uploads raw image binary with HMAC-SHA256 signature and UUID v4 idempotency key.

    Origin Request

  2. 02

    smallPict Edge CDN

    Global Edge PoPs

    Checks global edge cache. On cache HIT, delivers AVIF/WebP in <20ms worldwide.

    Cache & Delivery

  3. 03

    SmallPict API Gateway

    Authentication & Quotas

    Validates HMAC credentials, verifies quota limits, and scopes access to customer_id.

    Auth & Scoping

  4. 04

    Optimization Engine

    High-Speed Native Encoder

    Multi-threaded quantization transcode to AVIF & WebP with no visible quality loss and much smaller files.

    Transcoding

  5. 05

    Secure Storage & Sync

    Encrypted Cloud Storage

    Stores optimized output, invalidates outdated cache tags, and warms the edge cache.

    Persistent Sync

Zero Data Interception: End-to-end HMAC validation & SHA256 integrity check

Engine: smallPict

  1. 쿼터 차감 0%: 쿼터 서비스가 차감 로직을 건너뛰므로 로컬 테스트로 인해 유료 크레딧이 낭비되지 않습니다.
  2. 임시 스토리지 (24시간): 테스트 변환된 이미지는 프로덕션과 분리된 암호화 임시 처리 스토리지에 저장되며 24시간 후 자동 파기됩니다.
  3. 응답 헤더 식별자: 샌드박스 요청의 모든 응답에는 X-SmallPict-Sandbox: true HTTP 헤더가 포함됩니다.
  4. 단일 파일 테스트 한도: 샌드박스 환경에서는 최대 25MB의 파일까지 테스트할 수 있습니다.

샌드박스 SDK 연동 예제

Node.js

TypeScript
import { SmallPict } from '@smallpict/sdk';import fs from 'node:fs';
const sandboxClient = new SmallPict({  apiKey: 'sp_test_1234567890abcdef...',  secretKey: 'sec_test_secret123...'});
const result = await sandboxClient.optimize(fs.readFileSync('sample.jpg'), {  format: 'avif',  quality: 80});
console.log('샌드박스 변환 성공 URL:', result.url);

cURL

Shell
curl -X POST https://api.smallpict.app/v1/optimize \  -H "X-API-Key: sp_test_1234567890abcdef..." \  -H "X-Timestamp: 1716301234" \  -H "X-Signature: 3a9f8b2c4d6e..." \  -H "Content-Type: application/json" \  -d {  "filename": "sample.jpg",  "mime_type": "image/jpeg",  "filesize": 500000,  "options": {    "format": "webp",    "quality": 80  }}'