Download the PHP package blaspsoft/keysmith-react without Composer
On this page you can find all versions of the php package blaspsoft/keysmith-react. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download blaspsoft/keysmith-react
More information about blaspsoft/keysmith-react
Files in blaspsoft/keysmith-react
Package keysmith-react
Short Description A React & Inertia-powered API key management system for Laravel 12 React Starterkit, with secure token generation, revocation, and authentication.
License MIT
Homepage https://github.com/blaspsoft/keysmith-react
Informations about the package keysmith-react
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.
β¨ 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
Before installing Keysmith React, ensure your environment meets the following requirements:
- PHP 8.0+
- Laravel 12.x
- React 19.x
- Laravel Sanctum
π Installation
Install the package via Composer:
Choose Your Installation Template
You can install one (or both) of the available templates:
Page Template
Adds a dedicated API tokens page at pages/api-tokens/index.tsx
.
Settings Template
Integrates API token management within the Laravel Vue Starterkit settings at pages/settings/api-tokens.tsx
.
π§ Configuration
1οΈβ£ Configure Inertia Middleware
Add the following to your HandleInertiaRequests.php
middleware's share
method to enable API token flash messages:
Full example:
This ensures newly created API tokens are displayed to users.
2οΈβ£ Add Navigation Links
For the Page Template
Modify js/components/app-sidebar.tsx
:
For the Settings Template
Modify js/layouts/settings/layout.tsx
:
3οΈβ£ (Optional) Publish Configuration File
To customize settings, publish the config file:
This creates config/keysmith.php
, where you can modify key permissions.
π Dependencies
Keysmith React requires Laravel Sanctum for API token authentication.
-
Install Laravel Sanctum:
-
Publish and run Sanctumβs migrations:
- Add the
HasApiTokens
trait to yourUser
model:
π¦ Components
Keysmith React provides two main components located in /components
:
create-api-token-form.tsx
β Form for generating new API tokensmanage-api-tokens.tsx
β Component for viewing and managing existing tokens
These components are used in both Page and Settings templates.
π Routes
Page Template Routes
Settings Template Routes
π§ͺ Testing
Keysmith React includes tests in tests/Feature/ApiToken/
:
Run the tests with:
π Customizing Permissions
Modify the available API token permissions in config/keysmith.php
:
π Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.
π Credits
π License
This package is licensed under MIT. See LICENSE.md for details.