YesGraph’s Javascript SDK and Superwidget make use of custom jQuery events, allowing you to detect when your users import their contacts, or trigger invites. Here you’ll find a list of the supported events, with an example of how to get started.

As always, feel free to drop us a line with any questions!

Event Description
installed.yesgraph.sdk The Javascript SDK (used by the Superwidget) is installed, authenticated, and ready for use.
installed.yesgraph.superwidget The Superwidget is installed, authenticated, and ready for use.
imported.yesgraph.contacts The user’s contacts have been imported & ranked.
set.yesgraph.recipients The user confirmed recipients to invite (i.e., the user clicked “send” or “add emails”).
Using jQuery

The YesGraph Superwidget depends on jQuery. To work with Superwidget events in your code, you should include jQuery explicitly, as shown in the example below. This will ensure that jQuery loads before your event handlers run.

    <title>My Redirect Page</title>


    <script type="text/javascript">
    // Get the target destination from the "state" parameter
    var targetUrl = getUrlParam(location.href, "state");

    if (targetUrl) {
        if (targetUrl.indexOf("//") === -1) { targetUrl = "//" + targetUrl; }
        // Add the hash & url params to the target url
        var extra = [];
        if ( {
        if (location.hash) {
        if (extra.length > 0) {
            targetUrl += "#" + extra.join("&");
        // Redirect to the target destination
        location.href = targetUrl;
    } else {
        // This 'else' clause will likely never be used,
        // but it makes sense to have a sane default.
        location.href = location.origin + location.hash;

    function getUrlParam(url, key) {
        // Get a value from the url query parameters, or from the hash
        var key = key.replace(new RegExp("/[[]/"), "\[").replace(new RegExp("/[]]/"), "\]");
        var regexS = "[\?&#]" + key + "=([^&#]*)";
        var regex = new RegExp(regexS);
        var results = regex.exec(url);
        if (results == null)
            return "";
            return fullyDecode(results[1]);

    function fullyDecode(str) {
        // Recursively decode a URI component until it's fully decoded
        var decoded = decodeURIComponent(str);
        return decoded == str ? str: fullyDecode(decoded);