PHPackages                             getkeymanager/codeigniter-sdk - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. getkeymanager/codeigniter-sdk

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

getkeymanager/codeigniter-sdk
=============================

Official CodeIgniter 4 SDK for License Management Platform - Easy license validation, activation, and management for CodeIgniter applications

2.1(3mo ago)00MITPHPPHP ^7.4 || ^8.0

Since Jan 25Pushed 3mo agoCompare

[ Source](https://github.com/getkeymanager/codeigniter-sdk)[ Packagist](https://packagist.org/packages/getkeymanager/codeigniter-sdk)[ Docs](https://getkeymanager.com)[ RSS](/packages/getkeymanager-codeigniter-sdk/feed)WikiDiscussions main Synced 1mo ago

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

KeyManager - License Manager CodeIgniter SDK
============================================

[](#keymanager---license-manager-codeigniter-sdk)

For KeyManager ().

[![Latest Version](https://camo.githubusercontent.com/34f3efe5c7546f6a499de46a081aa129aa41781b59552d87685846b3814243ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6765746b65796d616e616765722f636f646569676e697465722d73646b2e737667)](https://packagist.org/packages/getkeymanager/codeigniter-sdk)[![License](https://camo.githubusercontent.com/06af6a632870a9c0bfe2b4bd313fc2ffdcf5f06c177cd7d63e6fd51709884e26/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6765746b65796d616e616765722f636f646569676e697465722d73646b2e737667)](https://packagist.org/packages/getkeymanager/codeigniter-sdk)

Official CodeIgniter 4 SDK for [License Management Platform](https://getkeymanager.com). Easy license validation, activation, and management for CodeIgniter applications with library support and helper functions.

Features
--------

[](#features)

- 🚀 **Easy Integration** - Simple library and helper functions
- 🎨 **CodeIgniter-Native** - Follows CodeIgniter 4 conventions
- 🛠️ **Helper Functions** - Convenient global functions
- 📝 **Full Logging** - Optional CodeIgniter logging integration
- ⚡ **Response Caching** - Automatic caching support
- 🔄 **CodeIgniter 4.x** - Full compatibility
- ✨ **NEW: State-Based Validation** - Enterprise-grade state management
- 🛡️ **NEW: Grace Period Support** - 72-hour failover protection
- 🔐 **NEW: Enhanced Security** - RSA-4096 signature verification
- 📊 **NEW: API Response Codes** - Standardized error handling

🆕 What's New in v2.0
--------------------

[](#-whats-new-in-v20)

The CodeIgniter SDK has been **hardened** with enterprise-grade features:

### State-Based Validation

[](#state-based-validation)

Instead of raw API responses, use typed `LicenseState` objects:

```
helper('getkeymanager');

$state = resolve_license_state($key);

if ($state->isActive()) {
    // License is fully active
} elseif ($state->isInGracePeriod()) {
    // Grace period - network issues
} else {
    // Invalid
}
```

### Grace Period Protection

[](#grace-period-protection)

Automatic 72-hour grace period when API is unreachable:

- Prevents service disruption from network issues
- Cached licenses remain valid temporarily
- Configurable duration

### Enhanced Error Handling

[](#enhanced-error-handling)

```
use GetKeyManager\CodeIgniter\Core\ApiResponseCode;
use GetKeyManager\CodeIgniter\Core\LicenseException;

try {
    $state = resolve_license_state($key);
} catch (LicenseException $e) {
    $code = $e->getApiCode();
    $name = $e->getApiCodeName();
    $message = ApiResponseCode::getMessage($code);
}
```

### New State-Based Helpers

[](#new-state-based-helpers)

```
// Check license status
is_license_active($key);
is_license_in_grace_period($key);

// Feature checking
can_use_feature($key, 'premium_reports');

// State management
$state = get_license_state($key);  // Get cached state
clear_license_state($key);          // Clear cache
```

**👉 See [HARDENING\_COMPLETE.md](HARDENING_COMPLETE.md) for full documentation**

**✅ 100% Backward Compatible** - All existing code continues to work!

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

[](#requirements)

- PHP 7.4 or higher
- CodeIgniter 4.0 or higher
- ext-json, ext-openssl, ext-curl

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

[](#installation)

Install via Composer:

```
composer require getkeymanager/codeigniter-sdk
```

### Configuration

[](#configuration)

Copy the configuration file to your `app/Config` directory:

```
cp vendor/getkeymanager/codeigniter-sdk/src/Config/GetKeyManager.php app/Config/
```

Edit `app/Config/GetKeyManager.php`:

```
