PHPackages                             blaspsoft/keysmith-vue - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. blaspsoft/keysmith-vue

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

blaspsoft/keysmith-vue
======================

A Vue &amp; Inertia-powered API key management system for Laravel 12 Vue Starterkit, with secure token generation, revocation, and authentication.

v1.0.1(1y ago)312411MITPHPPHP ^8.2

Since Mar 1Pushed 1y ago2 watchersCompare

[ Source](https://github.com/Blaspsoft/keysmith-vue)[ Packagist](https://packagist.org/packages/blaspsoft/keysmith-vue)[ Docs](https://github.com/blaspsoft/keysmith-vue)[ RSS](/packages/blaspsoft-keysmith-vue/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (0)

 [![Blasp Icon](./assets/icon.png)](./assets/icon.png)

 [![Total Downloads](https://camo.githubusercontent.com/3768f1e016aab953291497f5efcaf9708ebcbbf06c1246b5ce216d04c88f026c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626c617370736f66742f6b6579736d6974682d767565)](https://packagist.org/packages/blaspsoft/keysmith-vue) [![Latest Version](https://camo.githubusercontent.com/e87fbaa3cff504506ea2a8696b12296904df2511451e70d7ca0aa73664c43d95/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626c617370736f66742f6b6579736d6974682d767565)](https://packagist.org/packages/blaspsoft/keysmith-vue) [![License](https://camo.githubusercontent.com/668a9d00860c5b226855c54cc97c71aebfb5dea47a28a628ef8fe055fb65e189/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f626c617370736f66742f6b6579736d6974682d767565)](https://packagist.org/packages/blaspsoft/keysmith-vue)

Keysmith Vue - Laravel 12 Vue Starterkit API Token Management
=============================================================

[](#keysmith-vue---laravel-12-vue-starterkit-api-token-management)

Keysmith Vue is a Laravel 12 Vue Starterkit package that provides Vue.js components for managing API keys and tokens in your application. It offers a clean, user-friendly interface for creating, viewing, and revoking API keys with customizable permissions based on the implementation from Laravel Breeze.

Features
--------

[](#features)

- 🔑 Easy API token generation and management
- 🔒 Built on Laravel Sanctum's secure token authentication
- 🎨 Pre-built Vue components for quick integration
- 📱 Responsive and user-friendly interface
- ⚙️ Flexible installation options (page or settings templates)
- 🛠️ Customizable permissions system

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

[](#requirements)

- PHP 8.2 or higher
- Laravel 12.x
- Vue 3.x
- Laravel Sanctum

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

[](#installation)

You can install the package via composer:

```
composer require blaspsoft/keysmith-vue
```

Choose your preferred installation template:

### Page Template

[](#page-template)

Install this option to add a dedicated API tokens page at `pages/api-tokens/index.vue`. This provides a standalone interface for managing your API tokens.

### Settings Template

[](#settings-template)

Choose this option to integrate API token management within your Laravel Vue Starterkit settings at `pages/settings/APITokens.vue`. This keeps token management alongside your other application settings.

Run one (or both) of the following commands based on your choice:

```
php artisan keysmith:install page
```

or

```
php artisan keysmith:install settings
```

### Configure Inertia Middleware

[](#configure-inertia-middleware)

Add the following to your `HandleInertiaRequests.php` middleware's `share` method to handle API token flash messages:

```
'flash' => [
    'api_token' => fn () => session()->get('api_token'),
],
```

```
public function share(Request $request): array
    {
        [$message, $author] = str(Inspiring::quotes()->random())->explode('-');

        return [
            ...parent::share($request),
            'name' => config('app.name'),
            'quote' => ['message' => trim($message), 'author' => trim($author)],
            'auth' => [
                'user' => $request->user(),
            ],
            'flash' => [
                'api_token' => fn () => session()->get('api_token'),
            ],
        ];
    }
```

This configuration is required to display newly created API tokens to users.

### Add navlinks to starterkit templates

[](#add-navlinks-to-starterkit-templates)

Dependent of which template you decide to use 'page" or "settings" (or both). You may want to add links to the app sidebar and settings navigations.

For the page update `js/components/AppSidebar.vue`

```
const mainNavItems: NavItem[] = [
  {
    title: "Dashboard",
    href: "/dashboard",
    icon: LayoutGrid,
  },
  {
    title: "API Tokens",
    href: "/api-tokens",
    icon: KeyRound,
  },
];
```

For the settings update `js/layouts/settings/Layout.vue`

```
const sidebarNavItems: NavItem[] = [
  {
    title: "Profile",
    href: "/settings/profile",
  },
  {
    title: "Password",
    href: "/settings/password",
  },
  {
    title: "Appearance",
    href: "/settings/appearance",
  },
  {
    title: "API Tokens",
    href: "/settings/api-tokens",
  },
];
```

### Publish config \[optional\]

[](#publish-config-optional)

```
php artisan vendor:publish --tag=keysmith-vue-config --force
```

This command will publish a configuration file at `config/keysmith.php`, where you can customize keysmith settings.

Dependencies
------------

[](#dependencies)

This package requires Laravel Sanctum for API token authentication. Before using Keysmith Vue, make sure to:

1. Install Laravel Sanctum:

```
composer require laravel/sanctum
```

2. Publish and run Sanctum's migrations:

```
php artisan vendor:publish --provider="Laravel\Sanctum\SanctumServiceProvider" --tag="sanctum-migrations"
php artisan migrate
```

3. Add the HasApiTokens trait to your User model:

```
use Laravel\Sanctum\HasApiTokens;

class User extends Authenticatable
{
    use HasApiTokens;
    // ... existing code ...
}
```

Components
----------

[](#components)

Keysmith Vue provides two components that are installed in your `/components` directory:

- `CreateApiTokenForm.vue`: Form component for generating new API tokens
- `ManageApiTokens.vue`: Component for viewing and managing existing tokens

These components are utilized in both the page and settings templates.

Routes
------

[](#routes)

Keysmith Vue provides two sets of routes depending on your installation choice:

### Page Template Routes

[](#page-template-routes)

If you installed using the page template (`keysmith:install page`), these routes are available:

```
Route::get('/api-tokens', [TokenController::class, 'index'])->name('api-tokens.index');
Route::post('/api-tokens', [TokenController::class, 'store'])->name('api-tokens.store');
Route::put('/api-tokens/{token}', [TokenController::class, 'update'])->name('api-tokens.update');
Route::delete('/api-tokens/{token}', [TokenController::class, 'destroy'])->name('api-tokens.destroy');
```

### Settings Template Routes

[](#settings-template-routes)

If you installed using the settings template (`keysmith:install settings`), these routes are available:

```
Route::get('/settings/api-tokens', [TokenController::class, 'index'])->name('settings.api-tokens.index');
Route::post('/settings/api-tokens', [TokenController::class, 'store'])->name('settings.api-tokens.store');
Route::put('/settings/api-tokens/{token}', [TokenController::class, 'update'])->name('settings.api-tokens.update');
Route::delete('/settings/api-tokens/{token}', [TokenController::class, 'destroy'])->name('settings.api-tokens.destroy');
```

All routes are protected by authentication middleware and handle the following operations:

- `GET`: Retrieve all tokens for the authenticated user
- `POST`: Create a new API token
- `PUT`: Update token permissions
- `DELETE`: Revoke an existing token

Testing
-------

[](#testing)

Keysmith Vue includes test files that are placed in your project's `tests/Feature/ApiToken` directory:

- `PageTokenTest.php`: Tests for the page template implementation
- `SettingsTokenTest.php`: Tests for the settings template implementation

You can run the tests using:

```
php artisan test
```

### Customizing Permissions

[](#customizing-permissions)

You can customize the available token permissions by modifying the `config/keysmith.php` file:

```
return [
    'permissions' => [
        'read',
        'create',
        'update',
        'delete',
        // Add your custom permissions here
    ],
];
```

### Screenshots

[](#screenshots)

 [![keysmith](./assets/screenshots/keysmith_1.png)](./assets/screenshots/keysmith_1.png) [![keysmith](./assets/screenshots/keysmith_2.png)](./assets/screenshots/keysmith_2.png) [![keysmith](./assets/screenshots/keysmith_3.png)](./assets/screenshots/keysmith_3.png) [![keysmith](./assets/screenshots/keysmith_4.png)](./assets/screenshots/keysmith_4.png) [![keysmith](./assets/screenshots/keysmith_5.png)](./assets/screenshots/keysmith_5.png) [![keysmith](./assets/screenshots/keysmith_6.png)](./assets/screenshots/keysmith_6.png) [![keysmith](./assets/screenshots/keysmith_7.png)](./assets/screenshots/keysmith_7.png)

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Michael Deeming](https://github.com/modla)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance44

Moderate activity, may be stable

Popularity21

Limited adoption so far

Community9

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

Total

2

Last Release

434d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c728f738aa352593e59935f2b03a4bcafb2c721535f28684909a3b183c8467b7?d=identicon)[Deemonic](/maintainers/Deemonic)

---

Top Contributors

[![deemonic](https://avatars.githubusercontent.com/u/25927364?v=4)](https://github.com/deemonic "deemonic (10 commits)")

---

Tags

apiapi-token-managementapi-tokensapikey-managerauthenticationinertiajslaravellaravel-breezelaravel-sanctumlaravel12phpstarter-kitvuevue3blaspsoftkeysmith-vue

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/blaspsoft-keysmith-vue/health.svg)

```
[![Health](https://phpackages.com/badges/blaspsoft-keysmith-vue/health.svg)](https://phpackages.com/packages/blaspsoft-keysmith-vue)
```

###  Alternatives

[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6712.1k2](/packages/hasinhayder-tyro)[blaspsoft/socialiteplus

SocialitePlus is a Laravel package that simplifies social authentication by extending Laravel Socialite. It provides predefined Google, Facebook, GitHub, and LinkedIn login options for seamless integration into Laravel 12 Vue and React Starter Kits

612.8k](/packages/blaspsoft-socialiteplus)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)[pschocke/laravel-telegram-login-widget

Easily integrate Telegrams login widget into your Laravel application to send Telegram messages

1610.4k](/packages/pschocke-laravel-telegram-login-widget)[setiawanhu/sanctum-auth

Laravel package for generating user authentication feature using Laravel Sanctum

132.8k](/packages/setiawanhu-sanctum-auth)

PHPackages © 2026

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