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.6(2y ago)3119.6k↓44.9%19GPL-3.0-onlyPHP

Since May 30Pushed 1mo 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 1mo ago

READMEChangelog (10)DependenciesVersions (17)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

44

—

FairBetter than 92% of packages

Maintenance59

Moderate activity, may be stable

Popularity40

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity50

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 ~67 days

Recently: every ~11 days

Total

16

Last Release

811d 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

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

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