Download the PHP package visitor-analytics/3as-sdk without Composer

On this page you can find all versions of the php package visitor-analytics/3as-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 3as-sdk

TWIPLA PHP SDK

A simple API wrapper for integrating the Analysis as a Service (3AS) APIs provided by TWIPLA

Getting started

  1. Create an RSA Key Pair (PEM format)
  2. Send the resulting public key (jwtRS256.key.pub) to the TWIPLA Dev Team
  3. Install the library
  4. Use the SDK instance to interract with the API

Creating an RSA Key pair

  1. Create the keypair: ssh-keygen -t rsa -b 2048 -m PEM -f jwtRS256.key
  2. Convert the public key to PEM: openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub

Installation

Composer

Install via Composer

How to use the library

Concepts

Terms

General

Most endpoints that deal with customers or websites support some form of an ID which can be provided and then used for all following requests.

For example creating a new customer with a website requires an intpCustomerId and an intpWebsiteId. These must be provided by the INTP and are intended to make integrations easier because there is no need to save any external IDs. Then when getting data about a customer the request is done using the same intpCustomerId provided on creation.

Example implementation flow

  1. Create a new customer with a website
  2. Inject the resulting tracking code in the website's HTML
  3. Use the SDK's generate iframe url method to create an url
  4. Show an iframe to the user with the url created previously
  5. Show a modal to the user to upgrade his subscription
  6. Display all the available packages using the SDK
  7. After the payment is complete, use the SDK to upgrade the subscription of the website

Available APIs

Customers API

Integration partners (INTP) are able to get data about their customers (INTPc).

Register a new customer

List all available customers

Get a single customer by its INTP given id

Customer API

List all websites belonging to an INTP Customer

Delete a Customer belonging to an INTP

Generate the VisitorAnalytics Dashboard IFrame Url

This is one of the essential methods to use when using the iframe appoach 3AS. It creates an URL for a given customer and website combination that shows the TWIPLA dashboard in the theme configured by the INTP.

Packages API

An Integration Partner (INTP) is able to get data about their packages

List all available packages

Get a single package by ID

Create a package

Package API

An INTP can update its packages

Websites API

List all websites

Get a single website by its INTP given id

Create a website


Website API

Delete a website by its INTP given id

API for managing subscription state

Upgrade - immediately applies a higher stp count package to the subscription

Downgrade - auto-renew the subscription at the end of the current billing interval to a new lower stp count package

Cancel - disable the subscription auto-renewal at the end of the current billing interval

Resume - re-enable the subscription auto-renewal at the end of the current billing interval

Deactivate - immediately disables the subscription, reversible by an upgrade

Utils API

Generate a valid access token for the current INTP configuration.

Generate a valid access token for the current INTPc configuration.

Dashboard IFrame

The IFrame is one of the main ways a user can interract with the data gathered for his website. The URL of the IFrame is generated using the SDK

The resulting URL can be further enhanced with query parameters:

  1. allowUpgrade=true - Show upgrade CTAs

Upgrade buttons will be added to the Dashboard for all features that require a certain minimum package. Once the upgrade button is clicked, the iframe posts a message to the parent frame, containing the following payload:

Pagination

list methods support pagination options as follows:

If no pagination options are provided, the pageSize defaults to 10 items.

The page count starts from 0.


All versions of 3as-sdk with dependencies

PHP Build Version
Package Version
Requires nesbot/carbon Version ^3.0.0
lcobucci/jwt Version ^5.0.0
guzzlehttp/guzzle Version ^7.0.0
ext-json Version *
ext-openssl Version *
laminas/laminas-hydrator Version ^4.0.0
respect/validation Version ^2.0.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 visitor-analytics/3as-sdk contains the following files

Loading the files please wait ....