pltext/sdk

A simple PHP wrapper for the PLText API.

Maintainers

Package info

github.com/pltext/pltextphp

pkg:composer/pltext/sdk

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2025-09-16 14:39 UTC

This package is not auto-updated.

Last update: 2026-03-18 15:17:41 UTC


README

A simple PHP wrapper for the PLText API.

Installation

You can install the package via Composer.

composer require pltext/sdk

Usage

First, ensure you have your PLText API key. You can provide it directly or load it from a .env file using a library like vlucas/phpdotenv.

require 'vendor/autoload.php';

use Dotenv\Dotenv;
use Pltext\Pltext;

// Example of loading from a .env file
$dotenv = Dotenv::createImmutable(__DIR__);
$dotenv->load();
$apiKey = $_ENV['PLTEXT_API_KEY'];

// Or, provide the key directly:
$apiKey = "your_pltext_api_key_here";
$client = new Pltext($apiKey);

$content = "This is the text content you want to check for plagiarism.";

try {
    $result = $client->checkContent($content);
    print_r($result);
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage();
}

Local Development

For local development, you can create a .env file in the project root. Your application code (like in example.php) is responsible for loading these variables.

PLTEXT_API_KEY=your_pltext_api_key_here
PLTEXT_API_URL=http://localhost:5033/api/v1/check