PHPackages                             blaspsoft/keysmith-react - 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-react

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

blaspsoft/keysmith-react
========================

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

v1.0.2(10mo ago)92692MITTypeScriptPHP ^8.0|^8.1|^8.2

Since Mar 10Pushed 10mo ago3 watchersCompare

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

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

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

 [![Total Downloads](https://camo.githubusercontent.com/d59d0e5ccb876f55f1154378525f12d1ddf91609f980f756d1d33654df3e7a2d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626c617370736f66742f6b6579736d6974682d7265616374)](https://packagist.org/packages/blaspsoft/keysmith-react) [![Latest Version](https://camo.githubusercontent.com/5b980ab291aa6cb4bf818a2aaa6ec575a466a1edcd69b912d17b3adedc872eab/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626c617370736f66742f6b6579736d6974682d7265616374)](https://packagist.org/packages/blaspsoft/keysmith-react) [![License](https://camo.githubusercontent.com/31667a313fc08c3306bf68285ff3648dc14a7c8d9acd49372bd0f4a981ef4f47/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f626c617370736f66742f6b6579736d6974682d7265616374)](https://packagist.org/packages/blaspsoft/keysmith-react)

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

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

**Keysmith React** is a Laravel 12 React Starterkit package that provides React.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 Laravel Breeze.

---

🎥 Keysmith React Video Tutorial
-------------------------------

[](#-keysmith-react-video-tutorial)

[![Watch the Tutorial](https://camo.githubusercontent.com/f8bacdcdbdb8c946b8841125b583a9c5c39ddcfacb0e4eaf9c6e5f8f8ac4424e/68747470733a2f2f696d672e796f75747562652e636f6d2f76692f6355795954705f656170492f6d617872657364656661756c742e6a7067)](https://www.youtube.com/watch?v=cUyYTp_eapI)

**▶️ Click the image above to watch the tutorial on YouTube!**

✨ Features
----------

[](#-features)

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

---

🛠 Requirements
--------------

[](#-requirements)

Before installing **Keysmith React**, ensure your environment meets the following requirements:

- PHP **8.0+**
- Laravel **12.x**
- React **19.x**
- Laravel Sanctum

---

🚀 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require blaspsoft/keysmith-react
```

### Choose Your Installation Template

[](#choose-your-installation-template)

You can install one (or both) of the available templates:

#### **Page Template**

[](#page-template)

Adds a dedicated API tokens page at `pages/api-tokens/index.tsx`.

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

#### **Settings Template**

[](#settings-template)

Integrates API token management within the **Laravel Vue Starterkit** settings at `pages/settings/api-tokens.tsx`.

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

---

🔧 Configuration
---------------

[](#-configuration)

### 1️⃣ Configure Inertia Middleware

[](#1️⃣-configure-inertia-middleware)

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

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

**Full example:**

```
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 ensures newly created API tokens are displayed to users.

### 2️⃣ Add Navigation Links

[](#2️⃣-add-navigation-links)

#### **For the Page Template**

[](#for-the-page-template)

Modify `js/components/app-sidebar.tsx`:

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

#### **For the Settings Template**

[](#for-the-settings-template)

Modify `js/layouts/settings/layout.tsx`:

```
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",
  },
];
```

### 3️⃣ (Optional) Publish Configuration File

[](#3️⃣-optional-publish-configuration-file)

To customize settings, publish the config file:

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

This creates `config/keysmith.php`, where you can modify key permissions.

---

🔑 Dependencies
--------------

[](#-dependencies)

Keysmith React requires **Laravel Sanctum** for API token authentication.

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 React provides two main components located in `/components`:

- `create-api-token-form.tsx` → Form for generating new API tokens
- `manage-api-tokens.tsx` → Component for viewing and managing existing tokens

These components are used in both **Page** and **Settings** templates.

---

🌐 Routes
--------

[](#-routes)

Keysmith uses the routes defined below:

```
Route::get('/settings/api-tokens', [TokenController::class, 'index'])->name('settings.api-tokens.index');
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');
```

---

🧪 Testing
---------

[](#-testing)

Keysmith React includes tests in `tests/Feature/ApiToken/`:

Run the tests with:

```
php artisan test
```

---

🎛 Customizing Permissions
-------------------------

[](#-customizing-permissions)

Modify the available API token permissions in `config/keysmith.php`:

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

---

🔒 Security
----------

[](#-security)

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

---

📜 Credits
---------

[](#-credits)

- [Michael Deeming](https://github.com/deemonic)

---

📄 License
---------

[](#-license)

This package is licensed under **MIT**. See [LICENSE.md](LICENSE.md) for details.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance55

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.1% 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 ~90 days

Total

3

Last Release

300d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25927364?v=4)[Michael Deeming](/maintainers/Deemonic)[@deemonic](https://github.com/deemonic)

---

Top Contributors

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

---

Tags

apiapi-keyapi-key-managementauthenticationinertiajslaravellaravel-breezelaravel-sanctumlaravel12phpreactstarter-kitblaspsoftkeysmith-react

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[directorytree/ldaprecord-laravel

LDAP Authentication &amp; Management for Laravel.

5752.3M18](/packages/directorytree-ldaprecord-laravel)[illuminate/auth

The Illuminate Auth package.

10528.2M1.2k](/packages/illuminate-auth)[althinect/filament-spatie-roles-permissions

3481.1M10](/packages/althinect-filament-spatie-roles-permissions)[masterix21/laravel-licensing

Laravel licensing package with polymorphic assignment to any model, activation keys, expirations/renewals, and seat control via LicenseUsage. Supports offline verification with public-key–signed tokens, a CLI to generate/rotate/revoke keys, and an extensible architecture via config and contracts.

1563.0k4](/packages/masterix21-laravel-licensing)

PHPackages © 2026

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