SDKs
JavaScript

JavaScript SDK

Package @pcampus-studio/sdk อยู่ระหว่างพัฒนา หน้านี้แสดง API ที่วางแผนไว้ — ติดตามอัปเดตได้เร็วๆ นี้

API ที่วางแผนไว้

import { PcampusClient } from '@pcampus-studio/sdk'
 
const pip = new PcampusClient({
  apiKey: process.env.PIP_API_KEY,
  baseUrl: 'https://pip.pcampus.co',
})
 
// ดูข้อมูล user ปัจจุบัน
const user = await pip.identity.me()
 
// ตรวจสอบสิทธิ์
const { allowed } = await pip.access.check({
  userId: 'usr_xxxx',
  permission: 'console.users.read',
  context: { orgId: 'org_xxxx' },
})
 
// ดู organizations ทั้งหมด
const orgs = await pip.organizations.list()

ระหว่างนี้

ใช้ REST API โดยตรง — ทุก endpoint มีเอกสารใน API Reference

JavaScript SDK

The @pcampus-studio/sdk package is under development. This page shows the planned API — check back for updates.

Planned API

import { PcampusClient } from '@pcampus-studio/sdk'
 
const pip = new PcampusClient({
  apiKey: process.env.PIP_API_KEY,
  baseUrl: 'https://pip.pcampus.co',
})
 
// Get current user
const user = await pip.identity.me()
 
// Check permission
const { allowed } = await pip.access.check({
  userId: 'usr_xxxx',
  permission: 'console.users.read',
  context: { orgId: 'org_xxxx' },
})
 
// List organizations
const orgs = await pip.organizations.list()

In the meantime

Use the REST API directly — all endpoints are documented in the API Reference.