ZOWDOW Web SDK

© 2017 Zowdow, Inc.

Requirements

jQuery 2+

Usage:

Include files in <head> section:

<link rel="stylesheet" href="//d1jh24layu79ld.cloudfront.net/jsdk/zte/css/zowdow-sdk-v2.0.9.css">

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>

<script src="//d1jh24layu79ld.cloudfront.net/jsdk/zte/js/zowdow-sdk-v2.0.9.js"></script>

Then you have in global scope object <b>Zowdow</b>, that contains used classes, like <b>Suggestions</b>:

var sdk_instance = new Zowdow.Suggestions({
    // config
})

Also in jQuery you have some zowdow widgets:

$('.zowdow-search').zowdowSearch({
    // config
})

$('.zowdow-results').zowdowDiscovery({
    // config
})

Configurable Parameters

Parament Default Value Description
app_id com.zowdow.qa application id
useCache true cache for results
s_limit 10 limiting the number of suggestion
c_limit 10 limiting the number of cards in suggestion
card_format "inline" format of cards [inline/stamp/ticket]

You can set config on initialization or later with reapply jQuery plugin or with method <i>setToConfig</i> on instance of <b>Suggestions</b> class.

$('.zowdow-search').zowdowSearch({ // first call - initialization
    card_format: 'stamp'
})

$('.zowdow-search').zowdowSearch({ // call on initialized - updating config
    card_format: 'ticket'
})

// or

var suggestions = new Suggestions({ // initialization
    card_format: 'stamp'
})

suggestions.setToConfig({ // updating config
    card_format: 'ticket'
})

Methods

The following methods are available to you in instance of Zowdow.Suggestions
suggestions.getSuggestionsFor(query: String): Promise<Object> - returns json records with suggestions
suggestions.setToConfig(config: Object): void - update config with data from given object
suggestions.trackCardClick(url: String): void - track card click event
suggestions.trackCardImpression(url: String): void - track card impression event