Search by

lemonink / lemonink-php

edziubudzik

Official PHP client for LemonInk API

Package info

github.com/lemonink/lemonink-php

Homepage

pkg:composer/lemonink/lemonink-php

Statistics

Installs: 19 674

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.2.0 2026-10-19 09:06 UTC

This package is not auto-updated.

Last update: 2026-10-19 09:21:41 UTC


README

Getting started

  1. Sign up for LemonInk — Before you begin, you need to sign up for a LemonInk account and obtain an API key.
  2. Minimum requirements — To run the SDK, your system will need to meet the minimum requirements, including having PHP >= 5.5.

Example

<?php

require "vendor/autoload.php";

$client = new LemonInk\Client("your-api-key");

$transaction = new LemonInk\Models\Transaction();
$transaction->setMasterId("id-of-a-master-file");
$transaction->setWatermarkValue("Text you want to have embedded in your file");

$client->save($transaction);

echo "Download your file from {$transaction->getUrl()}\n";

Readium LCP

On an account (or master) that protects files with Readium LCP, pass a stable customer_ref so every book one buyer purchases opens with the same passphrase. Without it each transaction gets its own passphrase. Never derive the ref from an email address the buyer typed: anyone could type someone else's and read their passphrase.

$transaction->setLcpParams(["customer_ref" => "my-store/customer:42"]);