Download the PHP package klaviyo/php-sdk without Composer

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

php-klaviyo - RETIRED

Deprecation Notice

This SDK and its associated pip package are set to be deprecated on 2024-06-30 and will not receive further updates.

We recommend migrating over to our newest SDK.

You can read more about our SDK release history and support here

For a comparison between our old and new APIs, check out this guide.

Migration Instructions

NOTE: this change is not backwards compatible; migrating to the new SDK requires completing the following steps:

Install New SDK

composer require klaviyo/sdk

Update Import

From:

To:

Update Client Instantiation

From:

To:

Updating SDK Calls

The new SDK has many changes to namespace (resource and function names), parameters (names, types, and format), and error handling. Additionally, the new SDK sticks to just standard/built-in PHP types (int, string, array, etc), and does not make use of custom Models, as this legacy one does. Please reference this section of the new SDK repo for details on how to update each operation.

Multistore limitation

The new SDK currently sets API keys at a global environment level. This means that if you manage multiple stores, each store's client must be running in a different environment. We plan to update this behavior to better support multistore applications.

What is Klaviyo?

Klaviyo is a real-time service for understanding your customers by aggregating all your customer data, identifying important groups of customers and then taking action. http://www.klaviyo.com/

What does this package do?

How to install?

composer require klaviyo/php-sdk

API Examples

After installing the Klaviyo package you can initiate it using your public token which is for track events or identifying profiles and/or your private api key to utilize the metrics and list apis.

You can then easily use Klaviyo to track events or identify people. Note, track and identify requests take your public token.

Track an event

You can also add profile properties to the 'customer properties' attribute in the Event model

or just add a property to someone

You can get metrics, a timeline of events and export analytics for a metric. See here for more https://www.klaviyo.com/docs/api/metrics

You can create, update, read, and delete lists. See here for more information https://www.klaviyo.com/docs/api/v2/lists

You can fetch profile information given the profile ID, See here for more information https://www.klaviyo.com/docs/api/people

You can request a privacy-compliant profile deletion given an identifying property

Exceptions

Klaviyo\Exception\KlaviyoApiException

Thrown when there is an issue making an API request. After you catch this exception, you can use getMessage() and it will return a string containing more details about the issue that occurred.

Klaviyo\Exception\KlaviyoRateLimitException

If a rate limit happens it will throw a Klaviyo\Exception\KlaviyoRateLimitException. After you catch this exception you can use getMessage() and it will return a JSON encoded array: {"detail":"Request was throttled. Expected available in 26.0 seconds.","retryAfter":26}

Klaviyo\Exception\KlaviyoAuthenticationException

Thrown when there is an authentication error when making an API request, usually caused by an invalid API key.

Klaviyo\Exception\KlaviyoResourceNotFoundException

Thrown when the system attempts to update a property that doesn't exist. For example, attempting to update a list that doesn't exist on the account.


All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-json Version *
ext-curl Version *
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 klaviyo/php-sdk contains the following files

Loading the files please wait ....