Download the PHP package kirschbaum-development/bee-plugin-php-client without Composer

On this page you can find all versions of the php package kirschbaum-development/bee-plugin-php-client. 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 bee-plugin-php-client

Bee Plugin PHP Client

Latest Version on Packagist Actions Status StyleCI Total Downloads

PHP client to interact with Bee's plugin API. This includes the Message Services API and a convenient way to use authorization.

Installation

You can install the package via composer:

Usage

First thing you will need is to instantiate the Bee base class and setup the API token. You can grab the API token by logging in into the Developer portal and going to the "details" of your application.

Using Message Services API: HTML

This API allows you to post the JSON content generated on the Bee editor, and it will return the rendered HTML of the JSON. Reference: https://docs.beefree.io/message-services-api-reference/#html

Using Message Services API: PDF

This API allows you to post the HTML content and get an URL with a PDF created from the HTML. Reference: https://docs.beefree.io/message-services-api-reference/#pdf

Using Message Services API: Image

This API allows you to post the HTML content and get an URL with a PDF created from the HTML. Reference: https://docs.beefree.io/message-services-api-reference/#image

Generating access token

To initialize Bee Editor you may need an access token. You can use BeeAuth to easily generate that. You can grab the Client ID and Secret by logging in into the Developer portal and going to the "details" of your application.

Auth tokens are valid for 5 minutes. If you want to cache your tokens for as long as possible, you will need to pass a PSR-16 compatible cache implementation. Laravel, Symfony and all major frameworks are already compatible with this interface. To enable the cache, you only need to call the setCache method passing a Psr\SimpleCache\CacheInterface implementation.

Usage with Laravel

If you use Laravel, BeePluginServiceProvider will be auto-registered if you use Laravel package discovery. Otherwise, you can manually register the following provider:

This will make sure that any time you ask Laravel for KirschbaumDevelopment\Bee\Bee or KirschbaumDevelopment\Bee\BeeAuth using the Laravel container (e.g. app(Bee::class)), Guzzle will be automatically injected and also the API token and Client ID/Secret will be injected into the classes.

The config values will be extracted from the following config: .services.bee. So, we'll use the following conventions:

API Token: config('services.bee.api_token') Client ID: config('services.bee.client_id') Client Secret: config('services.bee.client_secret')

If you don't want to use this config, you can always pass the values manually.

Caching with Laravel

Laravel service provider will also automatically inject Laravel's cache implementation on BeeAuth, so your auth tokens will be cached for as long as possible.

Testing with Laravel

If you are writing integration tests, but don't want your tests making requests to Bee to get credentials, we have a little helper that can help you. Just run the following code:

With this, any time you call BeeAuth::generateToken() in your code you will receive the same response you would receive, but with some fake tokens and without making any HTTP requests.

Testing

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] or [email protected] instead of using the issue tracker.

Credits

Sponsorship

Development of this package is sponsored by Kirschbaum Development Group, a developer driven company focused on problem solving, team building, and community. Learn more about us or join us!

License

The MIT License (MIT). Please see License File for more information.


All versions of bee-plugin-php-client with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1|^8.0
guzzlehttp/guzzle Version ^6.3|^7.0
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 kirschbaum-development/bee-plugin-php-client contains the following files

Loading the files please wait ....