Git Product home page Git Product logo

bbcore's Introduction

BBCore

Build Status Code Climate Test Coverage

BombBomb makes it easy to build relationships with simple videos. Use this JavaScript API to record a video on your website, email it within a clean, beautiful design, and receive detailed analytics on opens, click and plays. With the free BombBomb app you can receive push notifications and respond right away when someone interacts with your email.

Quick Start

To begin, include the BBCore and jQuery libraries in your html (The latest version is available at https://static.bombbomb.com/js/BBCore.min.js):

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/3.4.0/jquery.min.js"></script>
<script type="text/javascript" src="https://static.bombbomb.com/js/BBCore.min.js"></script>

Then instantiate BBCore:

var bb = new BBCore({ accessToken: '<your access token or api key>', onerror: OnInvalidTokenCallback});

Usage Examples

Take a look in the examples/ directory to see some example implementation.

Record a Video On Your Website

Embed a video recorder on your website and record to a BombBomb account without leaving your site.

Create a video recorder and save a recording by calling startVideoRecorder(), specifying a css selector target into which you would like the recorder to appear.

bb.startVideoRecorder({ target: '#recorderDiv'}, function (vidInfo) {
 if (confirm('Is this the take you would like to save?')) {
     bb.saveRecordedVideo('Our video!', vidInfo.videoId, vidInfo.filename, function (data) {
         alert('Your video has been saved!');
     });
 }
});

IMPORTANT NOTE: If you intend to reuse the same BBCore object, it's HIGHLY recommended you call getNewVideoGuid() prior to calling startVideoRecorder. However, it's recommended that you otherwise destroy the BBCore object after the recorder has completed and create a new one.  

Send a Video in an Email Through BombBomb

Wrap your video in a nicely designed template, add a personal written message if you like, and press send.

To send a video in your default template, use videoQuickSend().

 

bb.videoQuickSend({
    subject: 'Your Subject Line',
    video_id: vidInfo.videoId, // saved from the earlier call
    email_addresses: '[email protected]',
    mobile_message: "Simple message to include"

}, function (data) {
    alert("You've sent a video! " + data.info);
});

 

Register to receive real-time feedback via web hooks

Have your system be notified in real-time as events happen in your customer's BombBomb account. BombBomb's Webhooks make it easy to keep your system up to date.

 

bb.sendRequest('AddWebHook', {
    hookUrl: '<Your Listener URL>'
});

 

Detailed Analytics

View your email opens, link clicks and video plays. When you can see how people are interacting with your emails and videos you'll know exactly when to follow up.

 

 

 

Realtime Notifications

Download the free BombBomb app for your iOS or Android device and enable realtime notifications. View contact details or respond from your mobile device with one click.

 

 

Classes

contacts
BBCore
videoOptions

Objects

BBCore : object

Functions

responseSuccess(responseObject, jqXHR)

reponseSuccess

Typedefs

responseSuccess : Object
responseObject : Object
OAuthClientCredentials : Object
responseSuccess : function

This callback is displayed as a global member.

requestParameters : object
getClientInteractionOptions : object
customVideoEmailOptions : object
responseSuccess : function

This callback is displayed as a global member.

contactProperties : Object
videoProperties : object

contacts

Kind: global class

contacts.add(contact) ⇒ contacts

Adds a Contact contact to Contacts collection

Kind: instance method of contacts

Param Type
contact contact

contacts.find(fieldName, value) ⇒ * | contact

Returns the first matched contact from

Kind: instance method of contacts

Param Type Description
fieldName string Name of the field to search for the value
value string Value to search for in the contacts

BBCore

Kind: global class

bbCore.resumeStoredSession

DEPRECATED - Use validateSession

Kind: instance property of BBCore

bbCore.getServerUrl() ⇒ BBCore.apiServer | * | BBCore.CONFIG.SERVER_API_URL

Kind: instance method of BBCore

bbCore.getRequestUrl() ⇒ string

Returns the fully qualified URL for BB API

Kind: instance method of BBCore

bbCore.sendRequest(method, [params], [success], [error])

Sends a request to the specified method of the BombBomb API

Kind: instance method of BBCore

Param Type Description
method string The method name to call
[params] requestParameters The parameters to send with the request
[success] responseSuccess A callback when the request succeeds
[error] responseSuccess A callback when the request fails

bbCore.login(uid, pwd, success)

Authenticates a user using their Email Address (User Id) and Password

Kind: instance method of BBCore

Param Type
uid string
pwd string
success responseSuccess

bbCore.credentialsSaved() ⇒ boolean

Returns bool for whether or not a prior authentication is stored locally

Kind: instance method of BBCore

bbCore.saveCredentials(uid, pwd)

Save credentials to local storage (not recommended)

Kind: instance method of BBCore

Param Type Description
uid string User ID/Email Address
pwd string Password

bbCore.validateSession(onSuccess, onError)

Authenticates from previously stored credentials

Kind: instance method of BBCore

Param Type
onSuccess responseSuccess
onError responseSuccess

bbCore.validateAccessToken(onSuccess)

Kind: instance method of BBCore

Param
onSuccess

bbCore.isAuthenticated() ⇒ boolean | *

Returns bool for authentication state

Kind: instance method of BBCore

bbCore.invalidateSession() ⇒ boolean | *

Invalidates and clears the active session, similar to logout

Kind: instance method of BBCore

bbCore.verifyKey(key, complete)

Validates the given key

Kind: instance method of BBCore

Param Type
key string
complete responseSuccess

bbCore.storeKey(key)

Stores the give session key, typically used so a session can be resumed later on.

Kind: instance method of BBCore

Param
key

bbCore.verifyJsonWebToken(key, complete)

Validates the given key

Kind: instance method of BBCore

Param Type
key string
complete responseSuccess

bbCore.storeOAuthTokens(key)

Stores the OAuth Token for API calls

Kind: instance method of BBCore

Param
key

bbCore.getOAuthPayload() ⇒ string

Kind: instance method of BBCore

bbCore.validateOAuthCode(authCode, onSuccess, onError)

Kind: instance method of BBCore

Param
authCode
onSuccess
onError

bbCore.refreshOAuthToken()

Kind: instance method of BBCore

bbCore.storeJsonWebToken(key)

Stores the give session key, typically used so a session can be resumed later on.

Kind: instance method of BBCore

Param
key

bbCore.getValidJsonWebTokenAsync(callback)

Attempts to always return a valid JWT which makes an async verification request

Kind: instance method of BBCore

Param Description
callback handler given a valid JWT. If the JWT is null then the user is NOT authenticated.

bbCore.getLists(success)

Retrieves Contact Lists

Kind: instance method of BBCore

Param Type
success responseSuccess

bbCore.createList(listName, success)

Creates a Contact List and returns the Guid

Kind: instance method of BBCore

Param Type
listName string
success responseSuccess

bbCore.getContact(contactId, success)

Retrieves a Contact

Kind: instance method of BBCore

Param Type
contactId string
success responseSuccess

bbCore.getListContacts(listId, success)

Retrieves Contacts from a Contact List

Kind: instance method of BBCore

Param Type
listId string
success responseSuccess

bbCore.addContact(contact, success)

Adds a Contact to a Contact List

Kind: instance method of BBCore

Param Type
contact contact
success responseSuccess

bbCore.bulkAddContacts(opts, success)

Adds a batch of Contacts

Kind: instance method of BBCore

Param Type
opts object
success responseSuccess

bbCore.updateContact(opts, success)

Kind: instance method of BBCore

Param Type
opts object
success responseSuccess

bbCore.getImportAddressesByType(opts, success)

Retrieves an Import Address by a Type

Kind: instance method of BBCore

Param Type
opts
success responseSuccess

bbCore.addContactImportAddress(opts, success)

Retrieves an Import Address by a Type

Kind: instance method of BBCore

Param Type
opts object
success responseSuccess

bbCore.getClientRecentInteractions(opts, success)

Retrieves a list of re

Kind: instance method of BBCore

Param Type
opts getClientInteractionOptions
success responseSuccess

bbCore.getEmails(success)

Retrieves a list of Emails from the current authenticated session

Kind: instance method of BBCore

Param Type
success responseSuccess

bbCore.sendCustomVideoEmail(opts, success)

Kind: instance method of BBCore

Param Type
opts customVideoEmailOptions
success function

bbCore.getDrips(opts, success)

Kind: instance method of BBCore

Param Type
opts object
success responseSuccess

bbCore.getForms(opts, success)

Kind: instance method of BBCore

Param Type
opts object
success responseSuccess

bbCore.getClientIntegrations(opts, success)

Kind: instance method of BBCore

Param
opts
success

bbCore.deleteVideo(videoId, success)

Deletes a Video

Kind: instance method of BBCore

Param Type
videoId string
success responseSuccess

bbCore.videoQuickSend(opts, onSuccess)

Kind: instance method of BBCore

Param Type
opts object
onSuccess responseSuccess

bbCore.getEmbeddedRecorderUrl([options], onComplete)

Kind: instance method of BBCore

Param Type
[options] Object
onComplete function

bbCore.getVideoRecorder(opts, onComplete)

Kind: instance method of BBCore

Param Type
opts object
onComplete function

bbCore.saveRecordedVideo(title, videoId, videoFilename, success)

Kind: instance method of BBCore

Param Type
title string
videoId string
videoFilename string
success function

bbCore.saveRecording(options)

Kind: instance method of BBCore

Param Type
options Object

BBCore.video

{Object} BBCore.videos

Kind: static class of BBCore

new video(properties)

Param Type
properties videoProperties

BBCore.contact

stuff

Kind: static class of BBCore
Properties

Name Type Description
email string Email Address
firstname string First Name
lastname string Last Name
phone_number string Phone Number
address_line_1 string Address 1
address_line_2 string Address 2
city string City
state string State
country string Country`
postal_code string Postal Code
company string Company
position string Position
comments string Comments
listlist string Array of List Ids the Contact is subscribed to
id string Contact Id

new contact(properties)

Contact Object

Param Type Description
properties contactProperties contactProperties

BBCore.video

BBCore.video

Kind: static class of BBCore
Properties

Name Type
vid_id string
title string
filename string

new video(properties)

Param Type
properties videoProperties

BBCore.CONFIG : Object

Kind: static constant of BBCore
Properties

Name
VERSION
API_END_POINT
SERVER_API_URL

videoOptions

Kind: global class
Properties

Name Type
vid_id string

BBCore : object

Kind: global namespace

bbCore.resumeStoredSession

DEPRECATED - Use validateSession

Kind: instance property of BBCore

bbCore.getServerUrl() ⇒ BBCore.apiServer | * | BBCore.CONFIG.SERVER_API_URL

Kind: instance method of BBCore

bbCore.getRequestUrl() ⇒ string

Returns the fully qualified URL for BB API

Kind: instance method of BBCore

bbCore.sendRequest(method, [params], [success], [error])

Sends a request to the specified method of the BombBomb API

Kind: instance method of BBCore

Param Type Description
method string The method name to call
[params] requestParameters The parameters to send with the request
[success] responseSuccess A callback when the request succeeds
[error] responseSuccess A callback when the request fails

bbCore.login(uid, pwd, success)

Authenticates a user using their Email Address (User Id) and Password

Kind: instance method of BBCore

Param Type
uid string
pwd string
success responseSuccess

bbCore.credentialsSaved() ⇒ boolean

Returns bool for whether or not a prior authentication is stored locally

Kind: instance method of BBCore

bbCore.saveCredentials(uid, pwd)

Save credentials to local storage (not recommended)

Kind: instance method of BBCore

Param Type Description
uid string User ID/Email Address
pwd string Password

bbCore.validateSession(onSuccess, onError)

Authenticates from previously stored credentials

Kind: instance method of BBCore

Param Type
onSuccess responseSuccess
onError responseSuccess

bbCore.validateAccessToken(onSuccess)

Kind: instance method of BBCore

Param
onSuccess

bbCore.isAuthenticated() ⇒ boolean | *

Returns bool for authentication state

Kind: instance method of BBCore

bbCore.invalidateSession() ⇒ boolean | *

Invalidates and clears the active session, similar to logout

Kind: instance method of BBCore

bbCore.verifyKey(key, complete)

Validates the given key

Kind: instance method of BBCore

Param Type
key string
complete responseSuccess

bbCore.storeKey(key)

Stores the give session key, typically used so a session can be resumed later on.

Kind: instance method of BBCore

Param
key

bbCore.verifyJsonWebToken(key, complete)

Validates the given key

Kind: instance method of BBCore

Param Type
key string
complete responseSuccess

bbCore.storeOAuthTokens(key)

Stores the OAuth Token for API calls

Kind: instance method of BBCore

Param
key

bbCore.getOAuthPayload() ⇒ string

Kind: instance method of BBCore

bbCore.validateOAuthCode(authCode, onSuccess, onError)

Kind: instance method of BBCore

Param
authCode
onSuccess
onError

bbCore.refreshOAuthToken()

Kind: instance method of BBCore

bbCore.storeJsonWebToken(key)

Stores the give session key, typically used so a session can be resumed later on.

Kind: instance method of BBCore

Param
key

bbCore.getValidJsonWebTokenAsync(callback)

Attempts to always return a valid JWT which makes an async verification request

Kind: instance method of BBCore

Param Description
callback handler given a valid JWT. If the JWT is null then the user is NOT authenticated.

bbCore.getLists(success)

Retrieves Contact Lists

Kind: instance method of BBCore

Param Type
success responseSuccess

bbCore.createList(listName, success)

Creates a Contact List and returns the Guid

Kind: instance method of BBCore

Param Type
listName string
success responseSuccess

bbCore.getContact(contactId, success)

Retrieves a Contact

Kind: instance method of BBCore

Param Type
contactId string
success responseSuccess

bbCore.getListContacts(listId, success)

Retrieves Contacts from a Contact List

Kind: instance method of BBCore

Param Type
listId string
success responseSuccess

bbCore.addContact(contact, success)

Adds a Contact to a Contact List

Kind: instance method of BBCore

Param Type
contact contact
success responseSuccess

bbCore.bulkAddContacts(opts, success)

Adds a batch of Contacts

Kind: instance method of BBCore

Param Type
opts object
success responseSuccess

bbCore.updateContact(opts, success)

Kind: instance method of BBCore

Param Type
opts object
success responseSuccess

bbCore.getImportAddressesByType(opts, success)

Retrieves an Import Address by a Type

Kind: instance method of BBCore

Param Type
opts
success responseSuccess

bbCore.addContactImportAddress(opts, success)

Retrieves an Import Address by a Type

Kind: instance method of BBCore

Param Type
opts object
success responseSuccess

bbCore.getClientRecentInteractions(opts, success)

Retrieves a list of re

Kind: instance method of BBCore

Param Type
opts getClientInteractionOptions
success responseSuccess

bbCore.getEmails(success)

Retrieves a list of Emails from the current authenticated session

Kind: instance method of BBCore

Param Type
success responseSuccess

bbCore.sendCustomVideoEmail(opts, success)

Kind: instance method of BBCore

Param Type
opts customVideoEmailOptions
success function

bbCore.getDrips(opts, success)

Kind: instance method of BBCore

Param Type
opts object
success responseSuccess

bbCore.getForms(opts, success)

Kind: instance method of BBCore

Param Type
opts object
success responseSuccess

bbCore.getClientIntegrations(opts, success)

Kind: instance method of BBCore

Param
opts
success

bbCore.deleteVideo(videoId, success)

Deletes a Video

Kind: instance method of BBCore

Param Type
videoId string
success responseSuccess

bbCore.videoQuickSend(opts, onSuccess)

Kind: instance method of BBCore

Param Type
opts object
onSuccess responseSuccess

bbCore.getEmbeddedRecorderUrl([options], onComplete)

Kind: instance method of BBCore

Param Type
[options] Object
onComplete function

bbCore.getVideoRecorder(opts, onComplete)

Kind: instance method of BBCore

Param Type
opts object
onComplete function

bbCore.saveRecordedVideo(title, videoId, videoFilename, success)

Kind: instance method of BBCore

Param Type
title string
videoId string
videoFilename string
success function

bbCore.saveRecording(options)

Kind: instance method of BBCore

Param Type
options Object

BBCore.video

{Object} BBCore.videos

Kind: static class of BBCore

new video(properties)

Param Type
properties videoProperties

BBCore.contact

stuff

Kind: static class of BBCore
Properties

Name Type Description
email string Email Address
firstname string First Name
lastname string Last Name
phone_number string Phone Number
address_line_1 string Address 1
address_line_2 string Address 2
city string City
state string State
country string Country`
postal_code string Postal Code
company string Company
position string Position
comments string Comments
listlist string Array of List Ids the Contact is subscribed to
id string Contact Id

new contact(properties)

Contact Object

Param Type Description
properties contactProperties contactProperties

BBCore.video

BBCore.video

Kind: static class of BBCore
Properties

Name Type
vid_id string
title string
filename string

new video(properties)

Param Type
properties videoProperties

BBCore.CONFIG : Object

Kind: static constant of BBCore
Properties

Name
VERSION
API_END_POINT
SERVER_API_URL

responseSuccess(responseObject, jqXHR)

reponseSuccess

Kind: global function

Param
responseObject
jqXHR

responseSuccess : Object

Kind: global typedef
Properties

Name Type
status string
method string
info Object

responseObject : Object

Kind: global typedef
Properties

Name Type
status string
method string
info Object

OAuthClientCredentials : Object

Kind: global typedef
Properties

Name Type Description
clientIdentifier string
clientSecret string
redirectUri string
type string 'implicit'

responseSuccess : function

This callback is displayed as a global member.

Kind: global typedef

Param Type
responseObject Object
[jqXHR] Object

requestParameters : object

Kind: global typedef
Properties

Name Type
method string
api_key string
async string
url string
url string

getClientInteractionOptions : object

Kind: global typedef
Properties

Name Type Description
activitySince string DateTime

customVideoEmailOptions : object

Kind: global typedef
Properties

Name Type
from_name string
email_id string
email string
subject string
html_content string

responseSuccess : function

This callback is displayed as a global member.

Kind: global typedef

Param Type
responseObject Object
[jqXHR] Object

contactProperties : Object

Kind: global typedef
Properties

Name Type Description
email string Email Address
firstname string First Name
lastname string Last Name
phone_number string Phone Number
address_line_1 string Address 1
address_line_2 string Address 2
city string City
state string State
country string Country`
postal_code string Postal Code
company string Company
position string Position
comments string Comments
listlist string Array of List Ids the Contact is subscribed to
id string Contact Id

videoProperties : object

Kind: global typedef
Properties

Name Type
vid_id string
title string
filename string

bbcore's People

Contributors

perl5punk avatar ehippy avatar cyrillegin avatar bbcharles avatar tompendergrass avatar amandaobringer avatar bbouley avatar zoey4560 avatar robballou avatar dubhunt avatar joelbeckham avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.