> For the complete documentation index, see [llms.txt](https://create.cloud4wi.ai/dev-hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://create.cloud4wi.ai/dev-hub/myapps/myapps-apis-and-sdk/access-journey-sdk.md).

# 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](/dev-hub/myapps/myapps-apis-and-sdk/context-apis.md) call.

### getParam(param)

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

‍

Available parameters:<br>

* **sk**: session key, used for the [context API call](/dev-hub/myapps/myapps-apis-and-sdk/context-apis.md)
* **tgr**: step of the Access Journey that invoked the App. The possible values are:\
  \&#xNAN;**-** trOpn: Connect\
  \&#xNAN;**-** trRgt: Sign up\
  \&#xNAN;**-** trPlgn: Log in Attempt\
  \&#xNAN;**-** trLgn: Log in\
  \- trLgt: Disconnect\
  \- false: When not part of the Access Journey<br>

### 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.<br>

Example:

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://create.cloud4wi.ai/dev-hub/myapps/myapps-apis-and-sdk/access-journey-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
