PHPackages                             sausin/signere-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. [API Development](/categories/api)
4. /
5. sausin/signere-sdk

AbandonedLibrary[API Development](/categories/api)

sausin/signere-sdk
==================

Package to work with Signere.no APIs for bankid implementation.

v0.2.6(8y ago)121MITPHPPHP &gt;=7.0

Since Aug 19Pushed 8y ago1 watchersCompare

[ Source](https://github.com/sausin/signere-sdk)[ Packagist](https://packagist.org/packages/sausin/signere-sdk)[ RSS](/packages/sausin-signere-sdk/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (8)Versions (14)Used By (0)

Signere SDK
===========

[](#signere-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d40e73718bb0513707144e3d89e907808564c88dca6633d61e27732d618c871f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73617573696e2f7369676e6572652d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sausin/signere-sdk)[![Build Status](https://camo.githubusercontent.com/bc41c802295d013a46737ed7e665eadc639271592e9726bc2761745b3ae6f005/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f73617573696e2f7369676e6572652d73646b2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/sausin/signere-sdk)[![Quality Score](https://camo.githubusercontent.com/b8fa41bed3fc659896d991fc4cddbbff9b60a2bb58cd437f6e0670a01810a97c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f73617573696e2f7369676e6572652d73646b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/sausin/signere-sdk)[![Scrutinizer Coverage](https://camo.githubusercontent.com/c1bfcbe899e7f80fa5449a179f70ddc21a6d5e8069ccd2adcf5c68490507d968/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f73617573696e2f7369676e6572652d73646b2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/sausin/signere-sdk)[![StyleCI](https://camo.githubusercontent.com/b3a9a47e3a91c17aeb06e9bb6d722e2d9efb29ffc94ef422e54c263247b473e6/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130303830333637372f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/100803677)[![Total Downloads](https://camo.githubusercontent.com/6b23985e47c20668cb37e7b12ba13a4cd27f712419a48d5cd31e85aa27da38f8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73617573696e2f7369676e6572652d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sausin/signere-sdk)[![License: MIT](https://camo.githubusercontent.com/1b01ef0024ba0866c115986b895301f657c1b21fc29f05c4844b7f2e8d89204d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT)

[Signere](https://www.signere.no/) provides APIs to perform authentication and signing of documents using various identification systems.

This package uses the publicly available [API documentation](https://api.signere.no/Documentation) provided by Signere and makes it easy to work with those APIs.

While it's created to work well with Laravel, it's possible to use the functionality of the package with any setup in PHP. An implementation of `Illuminate\Contracts\Config\Repository` is required in non-laravel environments to provide the configuration inputs for the package.

Laravel handles dependency injection using its powerful service container. If this package is used without Laravel, your application needs to manage the dependency injection on its own and inject the relevant classes.

Note that the controllers, service provider, routes and resources can only be used with Laravel.

Installing
----------

[](#installing)

Install via composer:

```
composer require sausin/signere-sdk
```

When using the package with Laravel 5.5 and upwards, the service provider will automatically be registered. For Laravel 5.4, the service provider needs to be registered in the `config/app.php` file as below:

```
Sausin\Signere\SignereServiceProvider::class
```

The config file should be published using the below artisan command:

```
php artisan vendor:publish --provider="Sausin\Signere\SignereServiceProvider"
```

The config file has the following keys setup for the package to function correctly:

```
'mode'              => null,
'id'                => env('SIGNERE_API_ID', 'id'),
'primary_key'       => env('SIGNERE_KEY_PRIMARY', 'primary_key'),
'secondary_key'     => env('SIGNERE_KEY_SECONDARY', 'secondary_key'),
'ping_token'        => env('PINGTOKEN', 'ping_token'),
'cancel_url'        => 'https://abc.com/auth/abort?requestid=[1]&externalid=[2]',
'error_url'         => 'https://abc.com/auth/error?status=[0]',
'success_url'       => 'https://abc.com/auth/success?requestid=[1]&externalid=[2]',
'sign_cancel_url'   => 'https://abc.com/auth/abort?requestid=[1]&externalid=[2]',
'sign_error_url'    => 'https://abc.com/auth/error?status=[0]',
'sign_success_url'  => 'https://abc.com/auth/success?requestid=[1]&externalid=[2]',
'identity_provider' => 'NO_BANKID_WEB',
```

Pre-requisites
--------------

[](#pre-requisites)

### Keys

[](#keys)

The `.env` file in the project this SDK is used in should have the following keys defined:

```
SIGNERE_API_ID
SIGNERE_KEY_PRIMARY
SIGNERE_KEY_SECONDARY
PINGTOKEN

```

These keys are provided by Signere when you register yourself with them.

If you're using this package without Laravel, then the these variables need to be provided by an implementation of `Illuminate\Contracts\Config\Repository`. This is injected to the respective classes where required.

### SSL

[](#ssl)

Your application needs to have an operational SSL configuration. This is required for bankID to work correctly, in iframe setups.

Usage
-----

[](#usage)

To make API calls, appropriate headers need to be set to signere can verify your requests are authentic. This is automatically taken care of by the `Header` class in this package. The specifications in Signere documentation for required headers in API calls have been used.

### Access Control with Laravel

[](#access-control-with-laravel)

If the package is used with Laravel, routes are automatically registered. Refer to the `routes/api.php` in this package to see all the available routes.

The routes are split into four groups - `admin`, `user`, `guest` and `bidder`. Access control is made possible by the `Signere` class which can be setup in the `AppServiceProvider` of the application using this package. An example is shown below:

```
Signere::auth(function ($request) {
    // return true / false;
});
```

Each controller's constructor method calls `Authenticate` middleware, which in turn calls the `Signere` class to check if the request is to be authenticated.

Most of the routes are organized under `admin` group as there is a cost to the operations performed.

### Utilizing Authentication Services

[](#utilizing-authentication-services)

The workflow for authentication is like this:

- Create a request using the `create` method on `RequestId` class. This method accepts an array of values and returns a `GuzzleHttp\Psr7\Response` object, which contains among other things the URL for signing
- Go to the URL above and provide your BankID credentials. Depending on the outcome of this authentication process, you will be redirected to one of the URLs given to the `create` method above
- When you want to logout or invalidate your login, use the `invalidate` method on `RequestId` class. This accepts a string input which corresponds to the `requestid` received on the response of the `create` method

### Utilizing Signing Services

[](#utilizing-signing-services)

Signing can be performed in two ways:

- External
- Signere way

The first method means that you create a document available for signing and distribute the URLs to the signees yourself.

In the second method, Signere does the hard work for you. You basically setup a process with Signere which sends out the notifications to signees. It is also possible to automate reminders.

... ...

### Tips

[](#tips)

Laravel supports [real time facades](https://mattstauffer.co/blog/real-time-automatic-facades-in-laravel-5-4) (since 5.4).

This can be very useful when you want to use a class from this package with injected dependencies and be able to test your own app's code. Read more about Laravel facades [here](https://laravel.com/docs/5.4/facades).

Further, this can also be useful in `tinker` to check if you are getting correct responses. For example on a `tinker` console:

```
>>> $r = Facades\Sausin\Signere\Events::getEncryptionKey()
=> GuzzleHttp\Psr7\Response {#1234}
>>> $r->getBody()->getContents()
=> ""fcbYIytltKmGrmd3lre71wpdBDn4D56dNjp8Bn1TROl=""
```

gets you an encryption key from Signere, corresponding to your setup! Also,

```
>>> Facades\Sausin\Signere\Events::getBaseUrl();
```

will give you the URL being used by the package. If you're in test/local environment, this will return `https://testapi.signere.no/api/events/encryptionkey` and `https://api.signere.no/api/events/encryptionkey` if you're in production.

### Commands

[](#commands)

This package ships with the artisan command `signere:renew`. It accepts an optional argument `--key=` which is either `primary` or `secondary`.

If nothing is specified, it uses `primary`. This is useful to renew your signere keys and can be combined with the powerful [scheduler](https://laravel.com/docs/5.4/scheduling#defining-schedules) that Laravel comes with so you don't have to worry about renewing your keys. Just set it up for renewal and forget about it :)

Credits
-------

[](#credits)

- Taylor Otwell and Mohamed Said for the awesome [Horizon](https://github.com/laravel/horizon) package which served as a template for this.
- Signere for providing an amazing API service to use BankId

Trademarks
----------

[](#trademarks)

All trademarks belong to their respective owners

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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

13

Last Release

3225d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1efa495645876ee7b1157fb11de36597784034a721f787738b655ac574bf88ef?d=identicon)[sausin](/maintainers/sausin)

---

Top Contributors

[![sausin](https://avatars.githubusercontent.com/u/11542923?v=4)](https://github.com/sausin "sausin (59 commits)")

---

Tags

apilaravelsignere

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sausin-signere-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/sausin-signere-sdk/health.svg)](https://phpackages.com/packages/sausin-signere-sdk)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.5M923](/packages/statamic-cms)[smodav/mpesa

M-Pesa API implementation

16167.1k1](/packages/smodav-mpesa)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

267880.7k3](/packages/laravel-cashier-paddle)[sunchayn/nimbus

A Laravel package providing an in-browser API client with automatic schema generation, live validation, and built-in authentication with a touch of Laravel-tailored magic for effortless API testing.

33437.0k](/packages/sunchayn-nimbus)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1122.7k](/packages/codebar-ag-laravel-docuware)

PHPackages © 2026

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