PHPackages                             gimucco/tiktok-loginkit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. gimucco/tiktok-loginkit

ActiveLibrary[API Development](/categories/api)

gimucco/tiktok-loginkit
=======================

TikTok Login Kit for Web in PHP

v0.6.7(3mo ago)3222.6k↓34%19GPL-3.0-onlyPHP

Since May 30Pushed 3mo ago7 watchersCompare

[ Source](https://github.com/andreaolivato/TikTok-LoginKit-PHP)[ Packagist](https://packagist.org/packages/gimucco/tiktok-loginkit)[ RSS](/packages/gimucco-tiktok-loginkit/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (10)DependenciesVersions (18)Used By (0)

TikTok Login Kit for PHP
========================

[](#tiktok-login-kit-for-php)

**TikTok Login Kit** implementation in PHP based on the [official documentation](https://developers.tiktok.com/doc/login-kit-web/).

This is an unofficial SDK for the official Login Kit APIs.

Features
--------

[](#features)

**The library has been updated to include video/image publish via Direct Post**

Current features include:

- Log in with TikTok
- Retrieve Basic User Information
- Retrieve Advanced User Information
- Retrieve Videos
- Paginate Videos
- Refresh Expired Token
- **NEW** Publish a Video with "Direct Post" via URL
- **NEW** Publish a Video with "Direct Post" via File
- **NEW** Publish one or more Images with "Direct Post" via URLs

Installation
------------

[](#installation)

Install via Composer

```
composer require gimucco/tiktok-loginkit

```

Requirements
------------

[](#requirements)

You need to have your app set up and approved in the [TikTok Developer Portal](https://developers.tiktok.com/).

If you're upgrading to the v2 TikTok API version, make sure you've added your *Redirect URLs* and selected the proper scopes.

Requirements for Direct Posts
-----------------------------

[](#requirements-for-direct-posts)

If you're planning to publish videos/photos via Direct Post, you need to undergo an audit. More info [here](https://developers.tiktok.com/application/content-posting-api)

Until you're approved:

- You can only publish private videos
- The account that you use for testing must also be private

Code Example for Logging in and retrieving basic info
-----------------------------------------------------

[](#code-example-for-logging-in-and-retrieving-basic-info)

```
// Initialize the class.
// $client_id and $client_secret are provided by TikTok.
// $redirect_uri must be approved in the TikTok developer portal.
$_TK = new TikTokLoginKit\Connector($client_id, $client_secret, $redirect_uri);
if (TikTokLoginKit\Connector::receivingResponse()) {
	try {
		$token = $_TK->verifyCode($_GET[TikTokLoginKit\Connector::CODE_PARAM]);
		// Your logic to store the access token
		$user = $_TK->getUser();
		// Your logic to manage the User info
		$videos = $_TK->getUserVideoPages();
		// Your logic to manage the Video info
	} catch (Exception $e) {
		echo "Error: ".$e->getMessage();
		echo 'Retry';
	}
} else {
	echo 'Log in with TikTok';
}

```

Alternative Constructor
-----------------------

[](#alternative-constructor)

If you prefer to use a .ini file to pass the api credentials, you can use the `TikTokLoginKit\Connector::fromIni` method. The .ini file should have this simple structure

```
client_id = [your client id]
client_secret = [your client secret]
redirect_uri = [your redirect uri]

```

And you call the alternative constructor by passing the path to the .ini file

```
$_TK = TikTokLoginKit\Connector::fromIni(__DIR__.'/env.ini');

```

Examples
--------

[](#examples)

Refer to the examples folder for a quick examples of how to use the login, fetch and paginate videos, publish videos

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance82

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~110 days

Recently: every ~201 days

Total

17

Last Release

96d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21fcc5ef8debc55ef7e12afd6b4989832af61994a7d9412bdcd2fd939d512e59?d=identicon)[andreaolivato](/maintainers/andreaolivato)

---

Top Contributors

[![andreaolivato](https://avatars.githubusercontent.com/u/100728?v=4)](https://github.com/andreaolivato "andreaolivato (3 commits)")

---

Tags

apiphpsdktiktok

### Embed Badge

![Health badge](/badges/gimucco-tiktok-loginkit/health.svg)

```
[![Health](https://phpackages.com/badges/gimucco-tiktok-loginkit/health.svg)](https://phpackages.com/packages/gimucco-tiktok-loginkit)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k16](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
