Framework overview
Building blocks
Security for Connect apps
Modules
JavaScript API
Last updated Sep 17, 2025

Ending Connect support

Have an existing Connect app? You can incrementally migrate it to Forge.

Context

A JavaScript module which provides functions for the current product context.

Methods

getToken (callback)

Retrieves the current user context as a JWT token containing details such as space key, issue id, etc. Throws an error if add-on does not support JWT authentication

Parameters

NameTypeDescription
callback

function

the callback that handles the response

Returns

1
2
[ 'Promise' ].<string>

A promise that contains the token

Example

1
2
AP.context.getToken(function(token){
  console.log("JWT token string", token);
});

getContext (callback)

Retrieves the current user context containing details such as space key, issue id, etc.

Parameters

NameTypeDescription
callback

function

the callback that handles the response

Returns

1
2
[ 'Promise' ].<Object>

A promise that contains the context

Example

1
2
AP.context.getContext(function(response){
  console.log("Jira Issue Key", response.issue_key);
  console.log("Confluence page id", response.pageId);
  console.log("license status", response.license);
});

Rate this page: