Embedded App SDK

Examples

Examples

Embedded App SDK ExamplesExamplesThe Embedded App SDK is already successfully powering many haravan-created apps. These provide a great example of what is possible with the EASDK. Although they appear to be native haravan features, these are in fact separately hosted and use the haravan API and the Embedded App SDK...

Getting started

Getting started

Embedded App SDK Getting startedGetting startedIn this article:What you getEnabling the Embedded App SDKHTTPS, SSL Certificates and mixed content restrictionsOAuthWhat you getThe Embedded App SDK has a robust window.postMessage API that provides:Custom modal windowsAlert, confirm and input dialogsTop bar with icon, breadcrumbs, buttons, pagination and dropdown menusFlash messagesEnabling the Embedded...

Features

Features

Embedded App SDK FeaturesFeaturesSome features are immediately available through the haravanApp object upon app.js file's load:In this article:Form SubmissionModal and Application CommunicationPrintingAuto-RedirectionError PagesForm SubmissionOn any form, you can add the attribute data-haravan-app-submit with the value matching the message value of one of the title bar buttons. When the button is...

Headers

Headers

Embedded App SDK HeadersHeadersThere are a few special considerations involving HTTP headers for configuring your application and server to operate correctly across browsers as an embedded app.In this article:X-Frame-Options HeaderInternet Explorer P3P Policy HeaderX-Frame-Options HeaderWeb servers have the option of setting a response header X-Frame-Options: DENY, meaning that the web...

Initialization

Initialization

Embedded App SDK InitializationInitializationTo expose the JavaScript API to your app, simply include the app.js at the top of your app's element. It has no dependencies but plays well with other libraries like jQuery. ... The SDK should be initialized with the API key and shop's...

Methods

Methods

Embedded App SDK MethodsMethodsThere are a number of methods that can be used on the haravanApp object:In this article:haravanApp.init(config)haravanApp.ready(fn)haravanApp.pushState(path)haravanApp.flashNotice(message)haravanApp.flashError(message)haravanApp.redirect(path)haravanApp.Bar.initialize(config)haravanApp.Bar.loadingOff()haravanApp.Bar.loadingOn()haravanApp.Bar.setTitle(title)haravanApp.Bar.setIcon(icon)haravanApp.Bar.setPagination(config)haravanApp.Bar.setBreadcrumb(config)haravanApp.Modal.open(init, fn)haravanApp.Modal.alert(options, fn)haravanApp.Modal.confirm(options, fn)haravanApp.Modal.input(options, fn)haravanApp.Modal.close(result, data)haravan.App.Modal.setHeight(height)haravanApp.User.currentButton objectsharavanApp.init(config)Should be called immediately after the script file has loaded, as early as possible on the page (not in a jQuery.ready() or something). It will initialize...