PHPackages                             xultech/devpayr-php-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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. xultech/devpayr-php-sdk

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

xultech/devpayr-php-sdk
=======================

Official DevPayr PHP SDK — License enforcement, API key management, and injectable protection for SaaS &amp; software.

v0.1.4(4mo ago)00MITPHPPHP ^8.1

Since Dec 24Pushed 4mo agoCompare

[ Source](https://github.com/DevPayr/devpayr-php-sdk)[ Packagist](https://packagist.org/packages/xultech/devpayr-php-sdk)[ RSS](/packages/xultech-devpayr-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

DevPayr PHP SDK
===============

[](#devpayr-php-sdk)

A lightweight and developer-friendly PHP SDK for integrating the [DevPayr](https://devpayr.com) platform — allowing you to validate license keys, fetch injectables, manage projects, control domains, enforce payments, and more.

Designed for software creators, SaaS founders, and digital product developers who want to secure and monetize their code with minimal effort.

🔰 Introduction
--------------

[](#-introduction)

DevPayr is a modern software licensing and payment enforcement platform built to help developers protect their code, enforce payment, and control how their software is used — across PHP, JavaScript, desktop, and SaaS environments.

This SDK enables seamless integration with DevPayr directly from your PHP application. Whether you're selling a script, distributing software, or building a SaaS, this SDK gives you the tools to:

- Validate license keys and enforce runtime restrictions
- Download and decrypt injectables (e.g., encrypted config or code blobs)
- Interact with your DevPayr projects, licenses, and domains
- Enforce project payment before allowing usage

### 🚀 Why Use DevPayr SDK?

[](#-why-use-devpayr-sdk)

Manually enforcing license checks, domain locks, and payment validation can be error-prone, time-consuming, and easily bypassed.

The DevPayr SDK solves this with:

✅ **One-Line Bootstrapping** – Validate license, check payment, auto-handle injectables in a single call
✅ **Secure Runtime Validation** – Block unauthorized use and unpaid projects at runtime
✅ **Customizable Failure Modes** – Redirect, log, silently fail, or show a branded modal on license failure
✅ **Injectable Decryption** – Distribute sensitive data like config, templates, or code snippets securely
✅ **Developer-Friendly API** – Create, revoke, validate licenses and domains easily from your app
✅ **Built-in Caching** – Avoid repeated license checks with intelligent cache

Whether you're distributing self-hosted scripts, WordPress plugins, SaaS dashboards, or internal tools — DevPayr SDK brings enforcement, control, and peace of mind.

### 🔧 Features

[](#-features)

- **License Verification**
    Securely validate license keys issued via DevPayr API.
- **Payment Enforcement**
    Block access to features or full app when payment is not completed.
- **Injectables Support**
    Automatically download, decrypt, and store encrypted files (templates, configs, snippets) tied to the license.
- **Domain Restriction**
    Verify if a request or instance is coming from an approved domain or subdomain.
- **Runtime Enforcement**
    Stop bootstrapping or execution on invalid/unpaid licenses with flexible fallback strategies (modal, redirect, log, silent).
- **Extensible Processor Hooks**
    Customize how injectables are handled via your own class (e.g., save to S3, memory, etc).
- **Lightweight &amp; Framework-Agnostic**
    Built in pure PHP without framework dependencies. Works in Laravel, WordPress, or any PHP app.
- **Fully Typed &amp; Exception-Driven**
    Catch invalid responses, network failures, and API violations with structured exceptions.
- **Built-in Caching**
    Automatically caches daily validation results in the OS temp folder to improve performance.
- **Custom Messaging &amp; Views**
    Show your own branded modal or custom message when a license is invalid.

### 📦 Installation

[](#-installation)

#### Install via Composer

[](#install-via-composer)

To install the DevPayr PHP SDK in your project, run the following command:

```
composer require xultech/devpayr-php-sdk
```

This will pull in the latest version of the SDK from Packagist and make it available for use in your PHP application.

#### 📋 Minimum Requirements

[](#-minimum-requirements)

Before installing the SDK, ensure your environment meets the following requirements:

- PHP **8.1** or higher
- Composer **2.0+**
- **OpenSSL** extension enabled (used for secure decryption)
- Either `cURL` **or** `allow_url_fopen` (for HTTP requests)

⚡ Quick Start
-------------

[](#-quick-start)

The DevPayr PHP SDK is designed for simple drop-in usage.

Below is a minimal working example that:

1. Validates the license
2. Checks if the project is paid
3. Fetches and handles any associated injectables

```
