@quantum-forge/tik-tok-business-sdk
v0.0.4-alpha-0.0.1
Published
Modern TypeScript SDK for the TikTok Business API with strict type checking and ESM support
Readme
TikTok Business API SDK for Deno
Modern TypeScript SDK for the TikTok Business API with strict type checking and Deno support.
Installation
Deno
import { ApiClient } from "https://deno.land/x/tiktok_business_api_sdk/mod";Or specify a version:
import { ApiClient } from "https://deno.land/x/[email protected]/mod";Usage
import { ApiClient, AdApi } from "https://deno.land/x/tiktok_business_api_sdk/mod";
// Get singleton instance
const client = ApiClient.instance;
// Configure the client
client.basePath = 'https://business-api.tiktok.com';
client.timeout = 30000;
// Set up OAuth2 authentication
client.authentications['oauth2'] = {
type: 'oauth2',
accessToken: 'YOUR_ACCESS_TOKEN'
};
// Create API instance
const adApi = new AdApi();
// Make API calls
try {
const response = await adApi.getAd({
advertiser_id: '123456',
ad_id: '789012'
});
console.log(response);
} catch (error) {
console.error('Error:', error);
}Features
- Full TypeScript support with strict typing
- Native Deno integration
- ESM modules
- Promise-based async/await API
- Comprehensive error handling
- Built-in TypeScript definitions
- No external dependencies
API Coverage
The SDK provides access to all TikTok Business API endpoints:
- Ad Management
- Campaign Management
- Audience Management
- Creative Management
- Report Generation
- And more...
Development
Requirements
- Deno 1.38.0 or higher
Running Tests
deno test --allow-netBuilding
deno bundle mod.ts dist/mod.jsContributing
- Fork it
- Create your feature branch (
git checkout -b feature/my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin feature/my-new-feature) - Create new Pull Request
License
MIT
