Generating and opening Gleap feature request portal link

Learn how to create a JavaScript function to generate Gleap feature request portal links and open them in a new tab or window.

At Gleap, we make it easy for you to gather valuable feedback and feature requests from your users through our feature request portal. If you'd like to generate and open a Gleap feature request portal link in your web application using JavaScript, this guide will show you how to do just that.

Generating a Gleap Feature Request Portal Link

To get started, you'll need to create a JavaScript function that generates the Gleap feature request portal link. Here's an example of how you can do it:

function generateFeatureRequestPortalLink() {
  // Call Gleap.getIdentity() to get the session object
  const sessionObject = Gleap.getIdentity();

  // Define the base URL for the feature request portal
  const featureRequestPortalBaseURL = 'https://app.gleap.io/sharedboard/';

  // Define the shared board ID as a variable
  const sharedBoardID = 'ogWhNhuiZcGWrva5nlDS8l7a78OfaLlV';

  // Extract the gleapId and gleapHash from the sessionObject
  const gleapId = sessionObject.gleapId || '';
  const gleapHash = sessionObject.gleapHash || '';

  // Construct the feature request portal link with the shared board ID, gleapId, and gleapHash as query parameters
  const featureRequestPortalLink = `${featureRequestPortalBaseURL}${sharedBoardID}?gleapId=${gleapId}&gleapHash=${gleapHash}`;

  return featureRequestPortalLink;
}

This function, generateFeatureRequestPortalLink(), creates the Gleap feature request portal link based on the user's Gleap session.

Opening the Generated Link

Once you have generated the Gleap feature request portal link, you may want to open it in a new tab or window for the user to access. Here's how you can do that using JavaScript:

function openFeatureRequestPortal() {
  const featureRequestPortalLink = generateFeatureRequestPortalLink();
  
  // Open the link in a new tab or window
  window.open(featureRequestPortalLink, '_blank');
}

The openFeatureRequestPortal() function opens the generated link in a new tab or window using window.open(). The '_blank' argument specifies that the link should open in a new tab or window.

Conclusion

By following the steps outlined in this guide, you can easily generate and open Gleap feature request portal links in your web application, providing your users with a convenient way to submit feedback and feature requests.

If you have any further questions or need assistance, please don't hesitate to reach out to our support team. We're here to help you make the most of Gleap's features and capabilities.

Did this answer your question?
😞
😐
😁