komptip/php-tiktok-sdk
最新稳定版本:v1.1.0
Composer 安装命令:
composer require komptip/php-tiktok-sdk
包简介
PHP sdk for TikTok
README 文档
README
This package provides an wrapper for TikTok REST API for PHP 8.3 and later
Requirements
- PHP >= 8.3
Installation
In your exist PHP application you can install this package using Composer.
composer require komptip/php-tiktok-sdk
Usage
Check documentation for basic understanding of configuration and usage, and user authentication for user authentication
Here is a basic example of how to use this package:
use Komptip\PhpTiktokSdk\PhpTiktokSdk; use Komptip\PhpTiktokSdk\AuthorizationScope; use Komptip\PhpTiktokSdk\UserField; $tiktok = new PhpTiktokSdk('client_key', 'client_secret'); // Get auth url $authUrl = $tiktok->createAuthUrl( scopes: [AuthorizationScope::UserInfoBasic, AuthorizationScope::UserInfoProfile], csrfState: $tiktok->createCsrfState(), redirectUri: 'https://example.com/callback' ); // Get access token $accessToken = $tiktok->getAccessToken($authorizationCode); // Get user info $userInfo = $tiktok->getUserInfo($accessToken['access_token'], [UserField::OpenID, UserField::Displayname]);
State of the project
This package is in early development stage. Not all endpoints are implemented yet.
- Login kit User authorization Ready to use Documentation
- Content posting API Posting videos and images to user profile Not implemented yet
- Data Portability API Getting user data such as activity, comments, etc. Not implemented yet
- Display API User profile information Ready to use Documentation
License
This package is licensed under the MIT License.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-19