Download the PHP package staffbase/plugins-sdk-php without Composer

On this page you can find all versions of the php package staffbase/plugins-sdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package plugins-sdk-php

Plugin SDK for PHP

Build Status License

If you are developing your own plugin for your Staffbase app we describe the authentication flow of a plugin at https://developers.staffbase.com/guide/customplugin-overview/. While this documentation just covers the conceptual ideas of the interface of plugins though – the so called Plugin SSO – we want to provide a library to help you develop your first plugin for Staffbase even faster. This SDK provides the basic functionality to parse and verify a provided token for PHP.

Installation

We provide our Plugin SDK via Composer (https://packagist.org/packages/staffbase/plugins-sdk-php). Thus, you can just use Composer for installation:

Dependencies

Dependencies are also managed by Composer. When using this repository keep the following dependencies in mind (cf. composer.json):

API Reference

For the API reference of this SDK please consult the docs.

Code Example

You can try to create a token from the received jwt.

To manage multiple instances easy and secure we provide a convenience class which abstracts the session. The PluginSession class has the same data interface as SSOToken. It also provides the means to set a custom session save handler as the optional third parameter of __construct. PluginSession will automatically take care of reading the URL parameters and saving the SSO info in the session for further requests after the Token gets invalid.

Remote calls

With the version 1.2.0 we introduced the concept of remote calls. These can happen if the Staffbase app need's to notify the plugin about an event which may be relevant. Events could be such as: a plugin instance gets deleted or a user should be logged out. For now we support only the instance-deletion call. You can find all supported calls in the RemoteCall namespace.

Please notice that a remote call will either be exited through proper implementation of RemoteCallInterface's exit functions or forcefully with a warning. This happens because practically there is no session to built after a call.

Contribution

Running Tests

To run the tests a simple # composer test command in the root directory will suffice. Please consult composer.json to learn which phpunit version is currently in use.

License

Copyright 2017-2022 Staffbase GmbH.

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0


All versions of plugins-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
lcobucci/jwt Version ^4.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package staffbase/plugins-sdk-php contains the following files

Loading the files please wait ....