PHPackages                             beebmx/kirby-sign - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. beebmx/kirby-sign

ActiveKirby-plugin[Utility &amp; Helpers](/categories/utility)

beebmx/kirby-sign
=================

Kirby Sign makes it easy to generate signed URLs for your Kirby site.

1.0.1(9mo ago)9741MITPHPPHP ^8.2CI passing

Since Jul 30Pushed 9mo agoCompare

[ Source](https://github.com/beebmx/kirby-sign)[ Packagist](https://packagist.org/packages/beebmx/kirby-sign)[ RSS](/packages/beebmx-kirby-sign/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (3)Used By (1)

[![Kirby Sign Logo](/.github/assets/logo.svg?raw=true)](https://github.com/beebmx/kirby-sign)

[![Build Status](https://camo.githubusercontent.com/d0186b4309af3808d2084e2ab75a635de3987856139a110a354b1e9822b8ae6f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f626565626d782f6b697262792d7369676e2f74657374732e796d6c3f6272616e63683d6d61696e)](https://github.com/beebmx/kirby-sign/actions)[![Total Downloads](https://camo.githubusercontent.com/ed045964e0cd90a2052e9552458588b092562517199492dbe5df33549a959069/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626565626d782f6b697262792d7369676e)](https://packagist.org/packages/beebmx/kirby-sign)[![Latest Stable Version](https://camo.githubusercontent.com/f9b8fa45b14fe90510234e042b19cc945b2f608057fb2ee4e05b0f93c40deae6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626565626d782f6b697262792d7369676e)](https://packagist.org/packages/beebmx/kirby-sign)[![License](https://camo.githubusercontent.com/c182829156124cb4852d51880f527a2f560b8e9d8e20c6ea78be93b61ceb9a2b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f626565626d782f6b697262792d7369676e)](https://packagist.org/packages/beebmx/kirby-sign)

Kirby Sign
==========

[](#kirby-sign)

`Kirby Sign` makes it easy to generate `signed` URLs for your Kirby site. These URLs include a secure signature to prevent tampering, ensuring that any shared link is protected from alteration. It’s perfect for confidently sharing public pages or creating temporary links for downloads and sensitive actions.

[![Kirby Courier example](/.github/assets/banner.jpg)](/.github/assets/banner.jpg)

---

Overview
--------

[](#overview)

- [1. Installation](#installation)
- [2. Usage](#usage)
- [3. Console](#console)
- [4. Helper](#helper)
- [5. Options](#options)
- [6. License](#license)
- [7. Credits](#credits)

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

[](#installation)

### Composer

[](#composer)

```
composer require beebmx/kirby-sign

```

Usage
-----

[](#usage)

`Kirby Sign` comes with two main features: [Sign URLs](#urls-signing) and [Validate URLs](#urls-validation). But first, you need to create a `key` to sign your URLs. This key should be placed in your `config.php` file.

```
'beebmx.kirby-sign' => [
    'key' => 'your-secret-key',
],
```

Note

You need to create your own key to sign your URLs. This key can be any string, but it's recommended to use a long and complex string to ensure security. If you need help with it, you can use the [console command](#console) that `Kirby Sign` provides to generate a key.

Warning

This key is used to sign your URLs, so it should be kept secret and not shared with anyone.

### URLs Signing

[](#urls-signing)

You can sign any URL using the `Beebmx\KirbySign\Facades\Signed` facade. Here's an example of how to sign a URL:

```
use Beebmx\KirbySign\Facades\Signed;

Signed::url('download/page');
```

This will return a signed URL that contains a `signature` to ensure that the URL has not been modified.

Sometimes you may need to sign a URL with additional parameters, such as an `id` or any other key to identify a user or a transaction, so you can send it with:

```
use Beebmx\KirbySign\Facades\Signed;

Signed::url('download/page', ['id' => 123, 'transaction' => 'abc']);
```

Sometimes you may need to expire a signed URL after a certain time, maybe for security reasons or to limit the access to a resource, you can do it by passing the `expires` option:

```
use Beebmx\KirbySign\Facades\Signed;
use Carbon\Carbon;

Signed::url(
    'transactional/page', expiration: Carbon::now()->addHour(),
);
```

In the example above, the signed URL will expire after one hour, and it uses `Carbon\Carbon` instance, but you can also use a `DateInterval` instance to set the expiration time.

```
use Beebmx\KirbySign\Facades\Signed;
use DateInterval;

Signed::url(
    'transactional/page', expiration: DateInterval::createFromDateString('1 hour')
);
```

By default, all signed URLs will be an absolute URL, but you can also create a relative URL by passing the `absolute` option as `false`:

```
use Beebmx\KirbySign\Facades\Signed;

Signed::url('some/page',  absolute: false);
```

### Page Signing

[](#page-signing)

`Kirby Sign` also comes with a `page method` to sign a page URL, this is useful if you want to sign a page URL without having to specify the full path.

```
$page->signed();
```

As the same as `Signed` facade, you can also pass additional parameters to the `page` method to sign a page URL with additional parameters:

```
use Carbon\Carbon;

// With additional parameters
$page->signed(['id' => 123]);

// With expiration time
$page->signed(['id' => 123], expiration: Carbon::now()->addHour());

// With relative URL
$page->signed(absolute: false);
```

### URLs Validation

[](#urls-validation)

Once you have signed a URL, you can validate it to ensure that it has not been modified and is still valid. A good place to validate a signed URL could be in a controller, but you are free to use it anywhere you need to validate a signed URL.

```
use Beebmx\KirbySign\Facades\Signed;

return function ($page) {
    if (! Signed::isValid()) {
        go('/', code: 302);
    }
};
```

If you decide to use a relative URL, you can also validate it by passing the `absolute` option as `false`:

```
use Beebmx\KirbySign\Facades\Signed;

return function ($page) {
    if (! Signed::isValid(absolute: false)) {
        go('/', code: 302);
    }
};
```

### Page Validation

[](#page-validation)

For convenience, `Kirby Sign` also provides a page method to validate a signed page URL.

```
return function ($page) {
    // Validate a signed page URL
    if (! $page->hasValidSignature()) {
        go('/', code: 302);
    }

    // Validate a signed page URL with relative URL
    if (! $page->hasValidSignature(absolute: false)) {
        go('/', code: 302);
    }
};
```

Console
-------

[](#console)

If you are a [Kirby CLI](https://github.com/getkirby/cli) user, `Kirby Sign` comes with a new command to help you create secure keys.

```
$ kirby key:generate
```

Note

`key:generate` command will only generate a random key that you can use to sign your URLs. You can then copy/paste this key in your `config.php` or environment file as shown in the [Usage](#usage) section.

If you have `.env` file, you can also use the command to set the key in your file:

```
$ kirby key:generate --env
```

Note

The `--env` option will set the `KIRBY_KEY` variable in your `.env` file with the generated key. If no `KIRBY_KEY` is present in your `.env` file, it will throw an error.

Helper
------

[](#helper)

For convenience, `Kirby Sign` provides a helper function to sign URLs and validate them.

```
// Sign a URL
sign()->url('some/page');

// Validate a URL
sign()->isValid();
```

In case you don't want to use the global `beebmx.kirby-sign.key`, you can pass a custom key to the helper function:

```
// Sign a URL with a custom key
sign('your-custom-key')->url('some/page');

// Validate a URL with a custom key
sign('your-custom-key')->isValid();
```

Options
-------

[](#options)

OptionDefaultTypeDescriptionbeebmx.kirby-sign.keynull`string`,`null`Set your own key to create and encrypt your signed or validated URLs.beebmx.kirby-sign.formatquery`string`You can set `query` or `params` to adjust the output format of the signed URL.beebmx.kirby-sign.signsignature`string`You can change the default `signature` parameter to sign or validate any URL.beebmx.kirby-sign.cipherAES-256-CBC`string`You can change the default algorithm to encrypt the key generation.Here's an example of a full use of the options from the `config.php` file:

```
'beebmx.kirby-sign' => [
    'key' => null,
    'format' => 'query',
    'sign' => 'signature',
    'cipher' => 'AES-256-CBC',
],
```

License
-------

[](#license)

Licensed under the [MIT](LICENSE.md).

Credits
-------

[](#credits)

`Kirby Sign` is inspired by the [Laravel Signed URLs](https://laravel.com/docs/master/urls#signed-urls)

- Fernando Gutierrez [@beebmx](https://github.com/beebmx)
- Jonas Ceja [@jonatanjonas](https://github.com/jonatanjonas) `logo`
- [All Contributors](../../contributors)

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance57

Moderate activity, may be stable

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~1 days

Total

2

Last Release

281d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/434a3fd09c4701e824184e720b3d2fd97814ed8d1275417f6762c411bf146328?d=identicon)[beebmx](/maintainers/beebmx)

---

Top Contributors

[![beebmx](https://avatars.githubusercontent.com/u/2191576?v=4)](https://github.com/beebmx "beebmx (2 commits)")

---

Tags

kirby-pluginkirby4kirby5signaturesignkirbykirby-pluginkirby5signedkirby4url-signedpage-signed

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/beebmx-kirby-sign/health.svg)

```
[![Health](https://phpackages.com/badges/beebmx-kirby-sign/health.svg)](https://phpackages.com/packages/beebmx-kirby-sign)
```

###  Alternatives

[beebmx/kirby-env

Enable env variables to Kirby

2037.9k2](/packages/beebmx-kirby-env)[arnoson/kirby-vite

Vite helper for Kirby CMS

9759.2k3](/packages/arnoson-kirby-vite)[belugadigital/kirby-navigation

Kirby 5 field for hierarchical menus with drag &amp; drop level indentation.

8713.4k](/packages/belugadigital-kirby-navigation)[bnomei/kirby3-dotenv

Kirby Plugin for environment variables from .env

4144.1k1](/packages/bnomei-kirby3-dotenv)[genxbe/kirby-ray

Helper tool that enables ray on all the extendable methods.

232.2k](/packages/genxbe-kirby-ray)[tobimori/kirby-icon-field

A simple Icon field plugin for Kirby CMS

5117.1k1](/packages/tobimori-kirby-icon-field)

PHPackages © 2026

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