Open In App Browser

Opens a URL in browser within the app

Description

The openInAppBrowser action opens a web page inside an in-app browser view — allowing users to browse external content (like blogs, help articles, or partner pages) without leaving your app environment.
This action is ideal for creating a seamless browsing experience while maintaining session and UI consistency.

Function Signature

VajroSDK.actions.openInAppBrowser({
		path: "https://www.superfans.io/features" //String
})
ParameterTypeRequiredDescription
pathStringyesThe complete URL to open (must begin with http:// or https://).

Structure of Response

StatusResponse
Success{ "status": "success", "message": "Url opened successfully" }
Invalid Url{ "status": "error", "errorId": 400, "errorHandle": "invalid-url", "message": "Invalid url" }
Unexpected Error{ "status": "error", "errorId": 500, "errorHandle": "unknown-error", "message": "Something unexpected happened" }

Example Usage

document.getElementById('openCartButton').addEventListener('click', () => {
   VajroSDK.actions.openInAppBrowser({
		path: "https://www.superfans.io/features" //String
})
});
<div class="cart-container">
  <button class="open-cart-btn" id="openCartButton">Visit our Website</button>
</div>
.cart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background-color: #f0f0f0;
}

.open-cart-btn {
  background-color: #28a745;
  color: #fff;
  border: none;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.open-cart-btn:hover {
  background-color: #218838;
}

Best Practices

  1. Use for extended reading: Perfect for articles, FAQs, or long-form content without leaving the app.
  2. Keep URLs secure: Always use https:// for better security and compatibility.
  3. Add contextual titles: Provide a clear title for better user orientation.

Caveats

  1. Network dependent: Requires internet access; handle offline states gracefully.
  2. Limited functionality: Not all web features (popups, file uploads) may be supported in-app.
  3. Session behavior: Browser view may not share cookies with native SDK sessions.
  4. Styling control: The toolbar and UI are partially controlled by the SDK, not the webpage.