stallzhan/tiktok-php-sdk-unofficial
最新稳定版本:1.0.0.0
Composer 安装命令:
composer require stallzhan/tiktok-php-sdk-unofficial
包简介
PHP login kit implemented according to tiktok document
关键字:
README 文档
README
PHP login kit implemented according to tiktok document
- Reference Docs
- https://developers.tiktok.com/doc/login-kit-overview/
- Login Kit
- This is an unofficial SDK for the official Login Kit APIs.
- Features
- Current features include:
- Generate TikTok Authorization
- Obtain tiktok V2 user information
- Get access token
- Refresh expired Token
- Currently under improvement
- Video Kit
Installation
composer require stallzhan/tiktok-php-sdk-unofficial
Basic Example
// include your composer dependencies require_once 'vendor/autoload.php'; try { $client = new \Tiktok\Client(); $client->setClientKey("xxx"); $client->setClientSecret("xxx"); $client->setScopes([ "user.info.basic", "video.upload" ]); $client->setState("xxx"); $client->setRedirectUri("xxx"); $authUrl = $client->createAuthUrl(); header("Location: $authUrl"); if ($_GET['code']) { $data = $client->fetchAccessTokenWithAuthCode($_GET['code']); $client->setCredentials($data); } } catch (Exception $e) { var_dump($e->getMessage()); }
Apis
Installation
Set credentials
$client->setCredentials($data);
Obtain tiktok V2 user information
$server = new \Tiktok\Service($client); $userinfo = $server->userinfo_v2->get();
Refresh expired Token
$data = $client->refreshToken();
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-15