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.

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

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:

  1. Initialization with individual parameters:

In this example, the EngagespotClient is initialized with individual parameters for the API key, API secret.

  1. 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.

Data Region

Data Region is an optional parameter that allows you to specify the region where the data is stored. The default region is us. Learn more about Data Region.

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

signing_key-71ae93037d6197a7db8a1894c2293079

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

Managing In-App Inbox Notifications

In-app inbox notifications are messages that users can view within your application. Here's how you can manage them using the EngagespotClient:

1. Initialization

Before you can interact with the in-app inbox notifications, you need to initialize the EngagespotClient with your API credentials:

2. Fetching In-App Notifications

You can fetch in-app notifications for a specific user. This retrieves a list of notifications from the in-app inbox.

3. Marking a Notification as Read

You can mark a notification as read once the user has viewed it.

4. Marking a Notification as Unseen

You can mark a notification as unseen to indicate that it hasn't been viewed by the user yet.

5. Marking a Notification as Unread

You can mark a notification as unread if the user has viewed it but hasn't interacted with it in a meaningful way.

6. Deleting a Notification

You can delete a notification from the in-app inbox if it's no longer relevant.


Managing Topics

Topics allow you to organize users into groups based on their interests or preferences. Here's how you can manage topics using the EngagespotClient:

1. Initialization

Before you can interact with topics, you need to initialize the EngagespotClient with your API credentials:

2. Creating a Topic

You can create a new topic with a name and an optional identifier. If an identifier is not provided, it will be generated from the name.

3. Updating a Topic

You can update the name of an existing topic.

4. Deleting a Topic

You can delete a topic.

5. Subscribing Users to a Topic

You can subscribe users to a topic.

6. Unsubscribing Users from a Topic

You can unsubscribe users from a topic.

7. Updating Notification Channels for a User in a Topic

You can update the notification channels for a user in a topic.

8. Listing Subscriptions of a User to All Topics

You can list the subscriptions of a user to all topics.


Workflows

You can manage workflows using the EngagespotClient: currently, only the cancellation of a running workflow is supported.

Initialization

Before you can interact with workflows, you need to initialize the EngagespotClient with your API credentials:

Cancel a running workflow

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!


All versions of php-sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0 || ^8.0
guzzlehttp/guzzle Version ^7.8
firebase/php-jwt Version ^6.10
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 engagespot/php-sdk contains the following files

Loading the files please wait ....