PHP Classes

How to Implement a PHP TikTok Live Streaming Integration Using the Package Laravel TikFinity Webhooks: Handle TikTok events using TikFinity Webhooks

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2025-06-08 (Yesterday) RSS 2.0 feedNot yet rated by the usersTotal: Not yet counted Not yet ranked
Version License PHP version Categories
laravel-tikfinity-we 1.0MIT/X Consortium ...5Web services, Video, PHP 7
Description 

Author

This package can handle TikTok events using TikFinity Webhooks.

It allows developers to register pipe handler classes that will process Web hook requests coming from the TikFinity TikTok live-streaming tool site.

Applications can provide classes to handle Webhook requests and reply to the requests to implement actions of interest of the applications.

Picture of Stefan Ninic
Name: Stefan Ninic <contact>
Classes: 9 packages by
Country: Bosnia and Herzegovina Bosnia and Herzegovina
Innovation award
Innovation award
Nominee: 6x

Instructions

Details

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads

<a href="https://www.buymeacoffee.com/KgBot"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a beer&emoji=?&slug=KgBot&button_colour=5F7FFF&font_colour=ffffff&font_family=Cookie&outline_colour=000000&coffee_colour=FFDD00"></a>

TikFinity Webhooks

This package provides a set of webhooks for TikFinity, allowing you to easily integrate TikTok LIVE events into your application.

Installation

You can install the package via Composer:

composer require kg-bot/laravel-tikfinity-webhooks

Configuration

After installing the package, you need to publish the configuration file:

php artisan vendor:publish --tag="tikfinity-webhooks-config

This will create a tikfinity-webhooks.php file in your config directory. You can customize the configuration as needed.

Migrations

You can publish the migrations using the following command:

php artisan vendor:publish --tag="tikfinity-webhooks-migrations"

Routes

The package provides a set of routes for handling TikTok webhooks. You can find the routes in the routes/web.php file. You can customize the routes as needed.

Usage

You can use the webhooks in your application to handle TikTok LIVE Gift and LIVE comment events.

To handle the events, you should configure the pipes in your tikfinity-webhooks.php configuration file. The package provides a set of example pipes that you can use to handle the events. You can also create your own pipes to handle the events as needed.

Profile

You can use the KgBot\TikfinityWebhooks\Models\TikTokProfile model to save TikTok profile information.

Example

You can use the package to handle TikTok LIVE Gift and LIVE comment events. Here is an example of how to handle a LIVE Gift event:

Create a Pipe

You can create a pipe to handle the LIVE Gift event. Here is an example of a pipe that verifies if the event is a gift event:

use Closure;
use KgBot\TikFinityWebhooks\Contracts\PipeContract;
use KgBot\TikFinityWebhooks\DTO\WebhookData;

final class VerifyGiftWebhook implements PipeContract
{
    /
     * @throws EventNotAllowed
     */
    public function handle(WebhookData $webhookData, Closure $next): mixed
    {
        if(!$webhookData->isGiftEvent()) {
            throw new EventNotAllowed('Event is not a gift event');
        }

        return $next($webhookData);
    }
}

Each pipe should implement the PipeContract interface and define the handle method. The handle method receives the WebhookData object and a closure to pass the data to.

Register the Pipe

You can register the pipe for each event in the tikfinity-webhooks.php configuration file by overwriting the pipes array. Here is an example of how to register the VerifyGiftWebhook pipe for the gift event:

return [
    'pipes' => [
        'gift' => [
            VerifyGiftWebhook::class,
            // Other pipes can be added here
        ],
    ],
];

Testing

composer test

License

This package is open-sourced software licensed under the MIT license.

Contributing

If you want to contribute to this package, feel free to open a pull request or create an issue. Your contributions are welcome!

Support

If you have any questions or need support, you can open an issue on the GitHub repository or contact me directly.


  Files folder image Files (23)  
File Role Description
Files folder image.github (1 directory)
Files folder imageconfig (1 file)
Files folder imagedatabase (1 directory)
Files folder imageroutes (1 file)
Files folder imagesrc (1 file, 6 directories)
Files folder imagetests (2 files)
Accessible without login Plain text file CODE_OF_CONDUCT.md Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files (23)  /  .github  
File Role Description
Files folder imageISSUE_TEMPLATE (2 files)

  Files folder image Files (23)  /  .github  /  ISSUE_TEMPLATE  
File Role Description
  Accessible without login Plain text file bug_report.md Data Auxiliary data
  Accessible without login Plain text file feature_request.md Data Auxiliary data

  Files folder image Files (23)  /  config  
File Role Description
  Plain text file tikfinity-webhooks.php Class Class source

  Files folder image Files (23)  /  database  
File Role Description
Files folder imagemigrations (1 file)

  Files folder image Files (23)  /  database  /  migrations  
File Role Description
  Plain text file 2025_05_18_212536_...ik_tok_profiles.php Class Class source

  Files folder image Files (23)  /  routes  
File Role Description
  Plain text file webhooks.php Class Class source

  Files folder image Files (23)  /  src  
File Role Description
Files folder imageContracts (2 files)
Files folder imageDTO (1 file)
Files folder imageExceptions (2 files)
Files folder imageHttp (2 directories)
Files folder imageModels (1 file)
Files folder imagePipes (2 files)
  Plain text file TikFinityWebhooksServiceProvider.php Class Class source

  Files folder image Files (23)  /  src  /  Contracts  
File Role Description
  Plain text file PipeContract.php Class Class source
  Plain text file TikTokProfileContract.php Class Class source

  Files folder image Files (23)  /  src  /  DTO  
File Role Description
  Plain text file WebhookData.php Class Class source

  Files folder image Files (23)  /  src  /  Exceptions  
File Role Description
  Plain text file EventNotAllowed.php Class Class source
  Plain text file ProfileBanned.php Class Class source

  Files folder image Files (23)  /  src  /  Http  
File Role Description
Files folder imageControllers (2 files)
Files folder imageMiddleware (1 file)

  Files folder image Files (23)  /  src  /  Http  /  Controllers  
File Role Description
  Plain text file CommentController.php Class Class source
  Plain text file GiftController.php Class Class source

  Files folder image Files (23)  /  src  /  Http  /  Middleware  
File Role Description
  Plain text file VerifyTikTokWebhookMiddleware.php Class Class source

  Files folder image Files (23)  /  src  /  Models  
File Role Description
  Plain text file TiktokProfile.php Class Class source

  Files folder image Files (23)  /  src  /  Pipes  
File Role Description
  Plain text file SkipIfProfileIsBanned.php Class Class source
  Plain text file VerifyGiftWebhook.php Class Class source

  Files folder image Files (23)  /  tests  
File Role Description
  Plain text file Pest.php Class Class source
  Plain text file TestCase.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads  
 100%
Total:0
This week:0