Download the PHP package clef/clef-php without Composer

On this page you can find all versions of the php package clef/clef-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 clef-php

Clef PHP bindings

Latest Stable Version License

A PHP wrapper for the Clef API. Authenticate a user and access their information in two lines of code.

You can sign up for a Clef account at https://getclef.com.

Requirements

PHP 5.3.3 and later.

Composer

You can install the bindings via Composer. Add this to your composer.json:

{
  "require": {
    "clef/clef-php": "1.*"
  }
}

Then install via:

composer install

To use the bindings, use Composer's autoload:

require_once('vendor/autoload.php');

Manual Installation

If you do not wish to use Composer, you can download the latest release. Then, to use the bindings, include the init.php file.

require_once('/path/to/clef-php/init.php');

Usage

Logging in a user

When a user logs in with Clef, the browser will redirect to your data-redirect-url. To retrieve user information, call get_login_information in that endpoint:

\Clef\Clef::initialize(APP_ID, APP_SECRET);
$response = \Clef\Clef::get_login_information($_GET["code"]);

For what to do after getting user information, check out our documentation on Associating users.

Logging out a user

When you configure your Clef integration, you can also set up a logout hook URL. Clef sends a POST to this URL whenever a user logs out with Clef, so you can log them out on your website too.

\Clef\Clef::initialize(APP_ID, APP_SECRET);
$clef_id = \Clef\Clef::get_logout_information($_POST["logout_token"]);

For what to do after getting a user who's logging out's clef_id, see our documentation on Database logout.

Sample App

If you'd like to see an example of this library in action, check out the Clef PHP sample application here.

Resources

Check out the API docs.
Access your developer dashboard.


All versions of clef-php with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.3
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 clef/clef-php contains the following files

Loading the files please wait ....