PHPackages                             la-souris/document-signer-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. la-souris/document-signer-sdk

ActiveLibrary

la-souris/document-signer-sdk
=============================

Provider-agnostic e-signature SDK for PHP: build envelopes from HTML templates with {\[type:signer:name\]} placeholders, render them to PDF, and send them through any SignatureProvider implementation (ValidSign, DocuSign, or your own).

v1.0.0(yesterday)04↑2900%4MITPHP ^8.2

Since Jul 22Compare

[ Source](https://github.com/la-souris/package-document-signer-sdk)[ Packagist](https://packagist.org/packages/la-souris/document-signer-sdk)[ RSS](/packages/la-souris-document-signer-sdk/feed)WikiDiscussions Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (4)

Document Signer SDK
===================

[](#document-signer-sdk)

A provider-agnostic PHP SDK for sending HTML documents through e-signature providers. You author contracts as HTML with `{[type:signer:name]}` placeholders; the SDK translates them to the provider's native anchor format, renders the HTML to PDF, and creates the envelope.

```
+-------------------+        +--------------------+        +----------------------+
|  HTML + signers   |  -->   |  documentsigner    |  -->   |  ValidSign /         |
|  (your code)      |        |  sdk + provider    |        |  DocuSign API        |
+-------------------+        +--------------------+        +----------------------+

```

Contents
--------

[](#contents)

- [Packages](#packages)
- [Framework integrations](#framework-integrations)
- [Fluent builder](#fluent-builder)
- [Page decoration](#page-decoration)
- [End-to-end example](#end-to-end-example)
- [Documentation](#documentation)
- [Requirements](#requirements)

Packages
--------

[](#packages)

PackagePathPurpose`la-souris/document-signer-sdk``sdk/`Domain model, placeholder parser, anchor-replacer base, Browsershot PDF renderer, `SignatureProvider` contract.`la-souris/document-signer-validsign``validsign/`ValidSign implementation.`la-souris/document-signer-docusign``docusign/`DocuSign eSignature implementation.All three are installed together for local development through the root `composer.json`, which exposes them as `path` repositories.

Framework integrations
----------------------

[](#framework-integrations)

Rather than wiring the SDK by hand, two packages integrate it into the popular PHP frameworks. Each gives you a container-managed `DocumentSignerManager` that resolves a `SignatureProvider` by name, verified webhook routes, and a signer- email **recipient override** for dev/staging. They mirror each other — same providers-list config, same webhook event — so the two stay conceptually identical:

PackageRepositoryPurpose`la-souris/document-signer-symfony`[document-signer-symfony](https://github.com/la-souris/package-document-signer-symfony)Bundle: configuration, driver manager, verified webhook routes, translated event labels.`la-souris/document-signer-laravel`[document-signer-laravel](https://github.com/la-souris/package-document-signer-laravel)Config, service provider, driver manager, facade, Blade placeholder components, verified webhook routes.Install the one matching your framework:

```
composer require la-souris/document-signer-symfony   # Symfony
composer require la-souris/document-signer-laravel   # Laravel
```

Fluent builder
--------------

[](#fluent-builder)

The positional `new Envelope(...)` constructor still works, but for step-by-step assembly there's a builder:

```
$envelope = Envelope::builder()
    ->name('NDA 2026-06')
    ->emailSubject('Please sign the NDA')
    ->emailMessage('Hi Jane, please sign at your convenience.')
    ->addDocument($document)
    ->addSigner($signer)
    ->signingOrder(SigningOrder::Parallel)
    ->withMetadata('contract_id', 42)
    ->build();
```

`addSigner()` and `addDocument()` each accept **either** a pre-built value object **or** the raw constructor arguments via named parameters, so you can mix styles depending on what reads best at each call site:

```
Envelope::builder()
    ->name('NDA')
    ->emailSubject('Please sign')
    // Pre-built object:
    ->addDocument(new Document(id: 'nda', name: 'NDA', html: $html))
    // Inline named args:
    ->addSigner(key: 'counterparty', name: 'Jane Doe', email: 'jane@example.com')
    ->build();
```

`build()` delegates every domain invariant (duplicate signer keys, empty document list, etc.) to `Envelope`'s constructor — so a half-configured builder never blows up mid-chain.

Page decoration
---------------

[](#page-decoration)

`Document` accepts optional header and footer HTML with per-document placement:

```
new Document(
    id:   'nda',
    name: 'NDA',
    html: 'NDA...',
    headerHtml: 'Acme Legal',
    footerHtml: 'Confidential',
    headerPlacement: HeaderPlacement::FirstPage,   // or ::AllPages
    footerPlacement: FooterPlacement::AllPages,
);
```

Under the hood the SDK's `PageDecoration` is threaded through to the PDF renderer. `AllPages` uses the underlying engine's native repeat-on-every-page header/footer slot; `FirstPage` inlines the HTML at the top/bottom of the body (since browsers have no native "first-page only" flag). See [PDF rendering](docs/pdf-rendering.md) for the details.

End-to-end example
------------------

[](#end-to-end-example)

```
use LaSouris\DocumentSigner\Sdk\Document\Document;
use LaSouris\DocumentSigner\Sdk\Envelope\Envelope;
use LaSouris\DocumentSigner\Sdk\Signer\Signer;
use LaSouris\DocumentSigner\Sdk\Signer\SigningOrder;
use LaSouris\DocumentSigner\ValidSign\ValidSignConfig;
use LaSouris\DocumentSigner\ValidSign\ValidSignProvider;

$envelope = new Envelope(
    name:         'NDA 2026-06',
    documents:    [
        new Document(
            id:   'nda',
            name: 'Non-disclosure agreement',
            html: 'NDASigned by {[text:counterparty:fullname]}'
                . '{[signature:counterparty:sig]} on {[date:counterparty:signdate]}',
        ),
    ],
    signers:      [
        new Signer(key: 'counterparty', name: 'Jane Doe', email: 'jane@example.com'),
    ],
    emailSubject: 'Please sign the NDA',
    emailMessage: 'Hi Jane, please sign at your convenience.',
    signingOrder: SigningOrder::Parallel,
);

$provider = new ValidSignProvider(
    new ValidSignConfig(apiKey: getenv('VALIDSIGN_API_KEY')),
);

$receipt = $provider->send($envelope);
// $receipt->providerEnvelopeId is now the ValidSign package id.
```

Swapping providers is a one-line change: instantiate `DocuSignProvider` with a `DocuSignConfig` instead — the `Envelope` is untouched.

Documentation
-------------

[](#documentation)

Start with [Getting started](docs/getting-started.md), then dive into the relevant guide:

- [Getting started](docs/getting-started.md)
- [Architecture](docs/architecture.md)
- [Placeholder syntax](docs/placeholders.md)
- [PDF rendering](docs/pdf-rendering.md)
- [ValidSign provider](docs/providers/validsign.md)
- [DocuSign provider](docs/providers/docusign.md)
- [Extending the SDK](docs/extending.md)
- [Writing a custom provider](docs/custom-provider.md)
- [Error handling](docs/errors.md)
- [Webhook events](docs/webhook-events.md)
- [Symfony integration](https://github.com/la-souris/package-document-signer-symfony)
- [Laravel integration](https://github.com/la-souris/package-document-signer-laravel)

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

[](#requirements)

- PHP 8.2
- A PDF renderer. The SDK bundles a `BrowsershotPdfRenderer` that wraps [spatie/browsershot](https://github.com/spatie/browsershot), but that package is an *optional* dependency you must install explicitly if you want to use the default: ```
    composer require spatie/browsershot
    ```

    Constructing `BrowsershotPdfRenderer` without it throws a clear install-hint. To use a different engine, implement `PdfRenderer` yourself (see [PDF rendering](docs/pdf-rendering.md)).
- Node.js + Puppeteer (only when using the Browsershot renderer — for headless Chromium)
- A ValidSign or DocuSign account with API credentials

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance100

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/930ca3b1756d00a63c8ff3363e81f16f961cf3ef79ff0c9d362670c36d97e456?d=identicon)[LauLaman](/maintainers/LauLaman)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/la-souris-document-signer-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/la-souris-document-signer-sdk/health.svg)](https://phpackages.com/packages/la-souris-document-signer-sdk)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
