app.js at the top of your app's
<head> element. It has no dependencies but plays well with other libraries like jQuery.
<head> <script src="https://cdn.haravan.com/s/assets/external/app.js"></script> ... </head>
The SDK should be initialized with the API key and shop's origin immediately after including the
This makes the
haravanApp object available and ready for use.
The script detects if your app was loaded inside an iframe. If not, it will create a redirection back into the relative embedded URL in the haravan admin. This functionality can be disabled by passing
forceRedirect: false as a configuration option.
You can include a
debug: true option as well to get detailed output into
console.log for browsers that support it.
On every page of your app that you'd like embedded, you should include an inline script tag which defines the behaviour of the haravan admin chrome in relation to your application. Here is a sample inline script for an embedded app view:
Once initialized, you can use any of the API methods and features provided with the SDK Embedded App SDK. Learn more about the available API methods in the haravan Embedded App SDK ›