Appearance
Installation
Requirements
| PHP | 8.2+ |
| Laravel | 12 or 13 |
anikeen/id | 3.6+ (installed as a dependency) |
| Guzzle | 7.8+ or 8 |
Install
The repository is private for now. Ask Anikeen for access, then add it as a Composer VCS repository (with a GitHub token or deploy key in auth.json):
json
"repositories": [
{"type": "vcs", "url": "https://github.com/anikeen-com/console-sdk"}
]bash
composer require anikeen/consoleThe service provider and the AnikeenConsole facade are registered through package discovery.
Set up anikeen/id first
The SDK uses the user's Anikeen ID tokens. Set up anikeen/id first - login with Anikeen ID and storing the tokens on the user:
Register the Socialite provider in your
AppServiceProvider:phpEvent::listen(function (\SocialiteProviders\Manager\SocialiteWasCalled $event) { $event->extendSocialite('anikeen', \Anikeen\Id\Socialite\Provider::class); });Add the Anikeen ID columns to your users table:
phpSchema::table('users', function (Blueprint $table) { $table->string('anikeen_id')->nullable()->unique(); $table->text('anikeen_id_access_token')->nullable(); $table->text('anikeen_id_refresh_token')->nullable(); });Keep the tokens encrypted (
'encrypted'casts) and out of JSON ($hidden).Request the Console scopes in the login and store the token pair in the callback:
phpuse Anikeen\Id\Enums\Scope; use Laravel\Socialite\Facades\Socialite; Route::get('auth/redirect', fn () => Socialite::driver('anikeen') ->scopes([Scope::CONSOLE_CONTAINERS]) ->redirect()); Route::get('auth/callback', function () { $account = Socialite::driver('anikeen')->user(); $user = User::updateOrCreate(['anikeen_id' => $account->getId()], [ 'name' => $account->getName() ?: $account->getNickname(), 'email' => $account->getEmail(), 'anikeen_id_access_token' => $account->token, 'anikeen_id_refresh_token' => $account->refreshToken, ]); Auth::login($user, remember: true); return redirect()->intended('/'); });
See the anikeen/id README for details. Which scopes to request is explained on Scopes.
Next: Configuration.