Access Journey SDK

The SDK can be included with your application by including the following tag in your HTML document.

<script src="https://splashportal.cloud4wi.com/myapps/v1/myapps-sdk.js"></script>

Including the script in your application gives access to the MYAPPS object. This object encapsulates a handful of functions that allow your application to integrate itself into the Access Journey provided by Cloud4Wi.

goNext()

Moves the user away from the page to the next destination on the Access Journey. This method is not available when the application is opened from the App Bar as it is not a part of the Access Journey.

getNextUrl()

Returns the URL that points to the next destination on the Access Journey. It is the same URL that would be used by the goNext() function to continue the Journey.

This method is not available when the application is opened from the App Bar as it is not a part of the Access Journey.

goHome()

Moves the user away from the page to the Welcome Portal. In many cases, has the effect of going Next, but can also have the effect of going back. Useful for App Bar applications that can use it as a "back" button in lieu of not having access to the goNext() function.

end()

Combines goNext() and goHome(). If available, will behave as goNext(), but revert to goHome() otherwise.

renderNavbar(navbarOptions)

Takes as an argument a JavaScript Object that contains options that are applied to the navigation bar. The options it supports are a delayed timer before the continue button is revealed, foreground and background color, and the text shown in the upper left corner.

let navbarOptions = {    
	apn: "Welcome",     // Label text for upper left    
  fontColor: "white",       // Font Color    
  backgroundColor: "black", // Background Color for gradient    
  nextBtn: 10         // Number of seconds for delay timer
}

The options object does not have to be filled, as there are default options that can be relied upon. One simply has to omit an entry in the object to revert to the default settings.

MYAPPS.renderNavbar(navbarOptions);

The styling is hardcoded into the nav tag that is produced, so apart from JavaScript manipulation, custom styling is fairly limited.

showNextBtn()

This function changes the style of the "next" button produced by the renderNavbar function from hidden to inline-block.

getSk()

Returns the session key necessary for the context API call.

getParam(param)

Returns the value of the given argument parameter by parsing the URL.

Available parameters:

  • sk: session key, used for the context API call

  • tgr: step of the Access Journey that invoked the App. The possible values are: - trOpn: Connect - trRgt: Sign up - trPlgn: Log in Attempt - trLgn: Log in - trLgt: Disconnect - false: When not part of the Access Journey

session(function)

Retrieve the session data and executes the callback function, function(SessionData). SessionData is false if there is any error, which is logged in the console.

Example:

var printSession = function(sessionData) {  
	console.log(sessionData);
  }  
  
MYAPPS.session(printSession);

Last updated