Parents SDK

Info Contents
Version 2.0.0
License GNU Lesser General Public License Version 3


The Parents SDK is completely separate from the KWS SDK. It will help you develop apps aimed at parents, rather than their kids. It integrates with the SuperAwesome Parent Portal, including a Single Sign On (SSO) mechanism so that parents can log into your app through their Parent Portal account.

Including the sources in your html

    <!-- (...) -->

    <!-- KWS SDK -->
    <script type="text/javascript" src=""></script>

Instantiating the SDK


  • The current implementation only requires front-end SDK using implicit flow, just make sure you set the option implicit to true when instantiating the SDK.
// KWS will provide all the necessary info for your account
var parentsSdk = new KwsParentsSdk({
    // The client id of your application provided by SuperAwesome
    clientId: 'your_client_id',
    // The language of your front-end here
    language: 'en',
    // It will use the implicit flow
    implicit: true,
    // (optional) If set must contain the token of the parent. (useful when working with iframe)
    token: 'BEARER TOKEN HERE',
    // (optional) If set to true will will consider the backend as a different domain
    crossDomain: true,
    // (optional) Must contain the backend url if `crossDomain` is set to true
    callbackHost: '',
    // (optional) If using any environment different to production, indicate here
    env: 'staging',
    // (optional) If using a different domain for the SSO platform
    ssoUrl: ''

Login or logout

If the parent is NOT logged in, you’ll want to display a login button; if the parent IS currently logged in, you’ll want to display a logout button instead. When you click on the button, this will call the action from the SDK to log in or log out.

    <button id="login" class="sa_sign_in" onclick="parentsSdk.signIn()"></button>
    <a href="#" id="logout" onclick="parentsSdk.signOut()">Logout (<span id="displayName"></span>)</a>
var parentsSdk = new KwsParentsSdk({
    clientId: 'your_client_id',
    implicit: true,
    language: 'en'
        console.log('Got parent data', parent);
        document.getElementById('logout').style.display = 'block';
        document.getElementById('login').style.display = 'none';
        document.getElementById('displayName').innerHTML =;
        console.log('Call failed. parent is not authenticated');
        document.getElementById('logout').style.display = 'none';
        document.getElementById('login').style.display = 'block';
        console.log('This is always called at the end when the response is received');

Get Parent Profile

This function allows you to get the parent’s profile

  • Function: app.parent.get

  • Parameters: none

  • Response:

    • id (Number): id of the user.
    • language (string) ISO 639-1 code.
    • dateOfBirth (string YYYY-MM-DD, optional). [1]
    • gender (string, optional) ‘m’ for male and ‘f’ for female. [1]
    • firstName (string, optional) [1]
    • lastName (string, optional) [1]
    • phoneNumber (string, optional) [1]
    • email (string, optional) [1]
    • streetAddress (string, optional) [1]
    • postCode (string, optional) [1]
    • city (string, optional) [1]
    • country (string, optional) [1]

    [1] This field will only be available if the corresponding permission is allowed.

  • Response example:

    "id": 2,
    "email": "",
    "streetAddress":"Example Street",
    "city":"Example City",
    "country": "United Kingdom"
  • Example:
        // Your resp handler here
        // Your resp handler here