# SDK Onboarding

This guide explains how to configure the process of the onboarding with Pixellot SDK, in case you haven't already done that.

# Prerequisites

  1. You have own back-end service and/or application that can "talk" to Pixellot services.
  2. You use Pixellot API v1.19.0 or above to "talk" to our service (at least to get events).

# Registration

Please, write an email to your contact person from Pixellot and provide such information:

  • Project name - name to be associated with your project
  • Email address - email to be associated with your project
  • Tenant - tenant associated with project (with validated tenant name using CMS)
  • API credentials

# Generation of projectID

To use all features of Pixellot WebSDK, you need to generate projectID your application.

Before you proceed to use all features of Pixellot WebSDK, firstly you need to generate projectID.

The projectID is required for SDKApi and Analytics.

To generate it you need to make the following

  1. Make POST request to Pixellot PartnerAPI on next url: 'https://api.pixellot.tv/v1/sdk/projects'
  2. Put name of your project in body - project prop.
  3. That's it - success response will return you the id of newly created project which you than can use now as a projectID in Pixellot WebSDK.

Example of request using JS Fetch API:

NOTE

Keep in mind that one project can have only one app ID per-platform (one WEB app and one Mobile app).

Further usage in PixellotWebSDK.SDKApi

  • SDKApi.projectId and SDKApi.session
    • Please make sure you're setting projectId and session object before any other usage of the SDK.
    • Both props are used inside of WebSDK only for signing requests for the API calls, so please make sure it's set at the top - before any other usage.

# Activation on Partner API

1. Login into Partner API with credentials received from Pixellot request.

Request:

Example of response:

"data": {
  "expiredIn": 1542287394,
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI1YmVjMWRlOGMwYzJjNjc0OWRiZTcxY2EiLCJyb2xlIjoiYWNjb3VudGFkbWluIiwidGVuYW50IjoiUGl4ZWxsb3QiLCJpYXQiOjE1NDIyNjYxMzIsImV4cCI6MTU0MjM1MjUzMn0.ON1hT9U9He1FfFrzqFsmKcI03usq9qbn3S4xw6pcRfw"
}

2. Generate RSA private and public keys by using OpenSSL (opens new window):

  • Generate private key, command: openssl genrsa -out private.pem 4096
  • Generate public key, command: openssl rsa -in private.pem -outform PEM -pubout -out public.pem

3. Encode public key into base64.

4. Activate project with request.

Request:

Example of response:

# Environment

Pixellot SDKs can work in two different environments:

  • production - make sure to use it in release configuration (when releasing to App Store / Google Play)
  • staging* - use in debug configuration and/or for e2e testing and integration

NOTE

When changing SDK environment make sure you are also using appropriate Partner API endpoint:

Below we will assume that you are activating your project for the production environment. But in most cases you will want to do the same for the staging environment as well so it can be used during the development phase.

Last Updated: 4/3/2023, 12:48:25 PM