# TikTok Shop
composer require socialiteproviders/manager
# Installation & Basic Usage
Please see the Base Installation Guide (opens new window), then follow the provider specific instructions below.
# Configuration
First, add your TikTok Shop app credentials to config/services.php:
'tiktokshop' => [
'client_id' => env('TIKTOKSHOP_APP_KEY'), // Your Partner Center App Key
'client_secret' => env('TIKTOKSHOP_APP_SECRET'), // Your Partner Center App Secret
'redirect' => env('TIKTOKSHOP_REDIRECT_URI'), // Your callback URI
],
Make sure you have these in your .env:
TIKTOKSHOP_APP_KEY=your_partner_center_app_key
TIKTOKSHOP_APP_SECRET=your_partner_center_app_secret
TIKTOKSHOP_REDIRECT_URI=https://yourapp.com/auth/tiktokshop/callback
# Add provider event listener
# Laravel 11+
In Laravel 11, register the listener directly in your AppServiceProvider@boot:
use SocialiteProviders\Manager\SocialiteWasCalled;
use App\Providers\Socialite\TikTokShop\TikTokShopExtendSocialite;
use Illuminate\Support\Facades\Event;
public function boot()
{
Event::listen(function (SocialiteProviders\Manager\SocialiteWasCalled $event) {
$event->extendSocialite('tiktokshop', \App\Providers\Socialite\TikTokShop\Provider::class);
});
}
Laravel 10 or below
Configure the package’s listener in app/Providers/EventServiceProvider.php:
protected $listen = [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
\App\Providers\Socialite\TikTokShop\TikTokShopExtendSocialite::class.'@handle',
],
];
# Usage
You can now redirect to TikTok Shop for authorization:
use Laravel\Socialite\Facades\Socialite;
return Socialite::driver('tiktokshop')->redirect();
And handle the callback:
$shopUser = Socialite::driver('tiktokshop')->user();
// Access mapped fields:
$shopUser->getId();
$shopUser->getName();
$shopUser->token;
$shopUser->refreshToken;
$shopUser->expiresIn;
# Returned User fields
id– the TikTok Shopopen_idnickname/name– theseller_nametoken– theaccess_tokenrefreshToken– therefresh_tokenexpiresIn– seconds until token expiry