Guides

Authentication

Các phương thức xác thực với DevKit.

Authentication

DevKit hỗ trợ nhiều phương thức authentication.

API Keys

Cách đơn giản nhất là dùng API key:

ts
const client = new DevKit({ apiKey: 'sk_live_...' });

OAuth 2.0

Cho user-facing apps, dùng OAuth flow:

ts
const authUrl = devkit.oauth.authorizeUrl({
  scopes: ['read', 'write'],
  redirectUri: 'https://app.example.com/callback',
});

Security Best Practices

Không bao giờ commit API keys vào version control. Dùng environment variables hoặc secrets manager.