API และ SDK ที่ทรงพลังสำหรับการพัฒนาแอปพลิเคชันธุรกิจ รองรับ REST API, OAuth 2.0, SAML 2.0 และ TypeScript SDK
API ที่ออกแบบมาเพื่อนักพัฒนา พร้อมเอกสารครบถ้วน
API ที่ออกแบบตามมาตรฐาน REST พร้อม JSON response และ HTTP status codes ที่ชัดเจน
รองรับ OAuth 2.0, SAML 2.0, และ JWT tokens สำหรับการยืนยันตัวตนที่ปลอดภัย
เอกสาร API แบบ interactive ด้วย Swagger UI พร้อมตัวอย่างและ schema ครบถ้วน
เข้าใจวิธีการทำงานของระบบ SSO
แอปพลิเคชันของคุณเริ่มต้น OAuth หรือ SAML flow โดยการ redirect ผู้ใช้ไปยัง Unity SSO
ผู้ใช้เข้าสู่ระบบผ่าน Identity Provider (Google, Microsoft, LINE, หรือ SAML IdP)
หลังจากยืนยันตัวตนสำเร็จ ระบบจะ redirect กลับพร้อม authorization code
แอปพลิเคชันแลกเปลี่ยน code เป็น access token และ refresh token
ใช้ access token เพื่อเรียก Unity SME Suite API endpoints
TypeScript/JavaScript SDK สำหรับการพัฒนาที่รวดเร็วยิ่งขึ้น
npm install @unity-sme/open-sdkimport { UnitySsoClient } from '@unity-sme/open-sdk';
const ssoClient = new UnitySsoClient({
apiUrl: 'https://api.unity-sme-suite.com',
tenantId: 'your-tenant-id',
});
// เริ่มต้น Google Login
const loginUrl = await ssoClient.initiateOAuthLogin('google');
window.location.href = loginUrl;
// จัดการ callback
const { code, state } = getCallbackParams();
const result = await ssoClient.handleOAuthCallback(code, state);
console.log('ผู้ใช้:', result.user);import { UnitySsoClient, SecureStorageAdapter } from '@unity-sme/open-sdk';
const ssoClient = new UnitySsoClient({
apiUrl: 'https://api.unity-sme-suite.com',
tenantId: 'your-tenant-id',
storage: new SecureStorageAdapter(),
});
// เริ่มต้น LINE Login
const loginUrl = await ssoClient.initiateOAuthLogin('line');
const result = await openAuthSessionAsync(loginUrl);
if (result.type === 'success') {
const auth = await ssoClient.handleOAuthCallback(
result.params.code,
result.params.state
);
}TypeScript definitions ครบถ้วนสำหรับ IntelliSense
รองรับ SAML 2.0, OAuth 2.0 (Google, Microsoft, LINE)
จัดการ session และ refresh tokens อัตโนมัติ
กำหนดค่า cross-origin requests อัตโนมัติ
Customize requests และ responses
Built-in rate limit handling
ตรวจสอบ webhook signatures
รองรับ localStorage, SecureStorage, custom adapters
ครอบคลุมทุกความต้องการทางธุรกิจ
เวอร์ชัน 1.1.0 • npm install @unity-sme/open-sdk
Next.js, React, Vue.js, Angular
React Native, Expo
Node.js, Express, NestJS
Powerful utilities for common development tasks
Built-in pagination helpers with async iterators
import { paginateAll } from '@unity-sme/open-sdk';
for await (const customer of paginateAll(
(params) => sdk.customers.list(params),
{ pageSize: 100 }
)) {
console.log(customer.name);
}Process multiple items efficiently
import { batchProcess } from '@unity-sme/open-sdk';
await batchProcess(
customerIds,
(ids) => sdk.customers.bulkUpdate(ids, { status: 'ACTIVE' }),
{ batchSize: 50 }
);Type-safe error handling with custom error classes
try {
const product = await sdk.products.get('prod-123');
} catch (error) {
if (error.code === 'NOT_FOUND') {
console.log('Product not found');
} else if (error.code === 'UNAUTHORIZED') {
console.log('Invalid API key');
}
}ทดลองใช้ API endpoints ได้ทันทีด้วย Swagger UI