Search by

jeffersongoncalves / laravel-klaviyo

jeffersongoncalves

Laravel integration for the Klaviyo API

Package info

github.com/jeffersongoncalves/laravel-klaviyo

pkg:composer/jeffersongoncalves/laravel-klaviyo

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-09-07 20:07 UTC

This package is auto-updated.

Last update: 2026-09-07 20:08:54 UTC


README

Laravel Klaviyo

Laravel Klaviyo

Laravel integration for the Klaviyo API

Installation

You can install the package via composer:

composer require jeffersongoncalves/laravel-klaviyo

Configuration

Set your Klaviyo private API key in .env:

KLAVIYO_API_KEY=pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Optionally publish the config file:

php artisan vendor:publish --tag="klaviyo-config"

Usage

use Jeffersongoncalves\LaravelKlaviyo\Facades\LaravelKlaviyo;

// Profiles
LaravelKlaviyo::createProfile(['email' => 'user@example.com', 'first_name' => 'Jane']);
LaravelKlaviyo::getProfile($id);
LaravelKlaviyo::updateProfile($id, ['first_name' => 'Jane']);
LaravelKlaviyo::listProfiles(['filter' => 'equals(email,"user@example.com")']);

// Lists
$list = LaravelKlaviyo::createList('Newsletter');
LaravelKlaviyo::addProfilesToList($list['data']['id'], [$profileId]);
LaravelKlaviyo::removeProfilesFromList($list['data']['id'], [$profileId]);
LaravelKlaviyo::deleteList($list['data']['id']);

// Events
LaravelKlaviyo::createEvent('Placed Order', 'user@example.com', ['order_id' => 123], value: 49.90);

// Campaigns, Flows, Metrics, Segments, Templates
LaravelKlaviyo::listCampaigns();
LaravelKlaviyo::listFlows();
LaravelKlaviyo::updateFlow($flowId, 'live');
LaravelKlaviyo::listMetrics();
LaravelKlaviyo::listSegments();
LaravelKlaviyo::listTemplates();

All methods throw Jeffersongoncalves\LaravelKlaviyo\LaravelKlaviyoException on a failed API response.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email the author instead of using the issue tracker.

Credits

License

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