Download the PHP package engagespot/php-sdk without Composer
On this page you can find all versions of the php package engagespot/php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download engagespot/php-sdk
More information about engagespot/php-sdk
Files in engagespot/php-sdk
Package php-sdk
Short Description This is the php library for Engagespot
License MIT
Informations about the package php-sdk
Engagespot PHP SDK
The Engagespot PHP SDK enables seamless integration and notification sending via the Engagespot API in PHP applications. Engagespot provides a unified platform for delivering targeted notifications to users through channels like in-app messages, web push, and email.
Installation
Install the Engagespot PHP SDK using Composer:
Getting Started
Step 1: Obtain API Credentials
Sign up for an account on Engagespot and acquire your API key and API secret.
Step 2: Initialize EngagespotClient
Include the Engagespot PHP SDK in your PHP code and create an instance of EngagespotClient
with your API key, API secret, and signing key (if applicable):
here are examples of the two types of initializations for the EngagespotClient
:
- Initialization with individual parameters:
In this example, the EngagespotClient
is initialized with individual parameters for the API key, API secret.
- Initialization with an associative array:
In this example, the EngagespotClient
is initialized with an associative array that includes the API key, API secret, signing key, and base URL.
Remember to replace 'your-api-key'
, 'your-api-secret'
, and 'your-signing-key'
with your actual Engagespot API credentials. The base URL is optional and defaults to 'https://api.engagespot.co/v3' if not provided. The signing key is also optional and can be omitted if not used.
Step 3: Sending a Notification
Sending a Notification
Prepare notification data and use the send
method:
Legacy Payload
Preferred Payload
Sending the notification
Create OR Update User
You can add any keyvalue pairs to profile.
Generating User Token
Generate a JWT token for a user for authentication:
Note : Remember that for generating user token you must need to Initialize engagespot via associative array OR by
because signingKey is required for generating user tokens
Creating Signing Key
You can generate your public-private signing key pair from Engagespot console, and this private key should be the secret signing key for generating user tokens
NOTE: When you generate the signing key, Engagespot will store only the public key in our database. You should download the private key and use it for signing your user tokens. You won't be able to retrieve the private key after this step.
Additional Configuration
Set additional configuration options if needed:
You can set SigningKey after initializing EngagespotClient
by
Exceptions
The SDK throws \InvalidArgumentException
for missing or invalid parameters during initialization or notification creation.
Note
Replace placeholder values such as 'your-api-key'
, 'your-api-secret'
, and 'your-signing-key'
with your actual Engagespot API credentials.
For detailed information about Engagespot API parameters, refer to the Engagespot API documentation.
Feel free to explore and contribute to the SDK!