Welcome to the Ribbit Javascript SDK
We are very proud to launch our Javascript SDK. This library uses our REST service and OAuth based authentication to allow you to start phone calls, send and recieve messages. You can even do clever things like record calls and play them back through the browser!
To get started, you need to set your application up for two legged authentication. The best way to do that is using the Kermit tool, available to download on this site.
Once you've done this, you intialize the Ribbit library in a web page this way, with values for the parameters set to be details of an application you've set up on this Ribbit developer web site.
Ribbit.init("consumer token","app id","domain");
Then you can login - you should be able to use the credentials you log in to the developer portal with, but if you reset your password on the developer portal, it's possible your password into your application won't be changed, and be out of step.
Notice that we pass a callback function in as the first parameter - this is common in many of the methods you'll use.
function onLoggedIn(result){
if (result.hasError){
alert ("something went wrong... " + result.message);
}
else{
alert("Welcome, " + Ribbit.username);
}
}
Ribbit.login(onLoggedIn, "username","password");
Then you can go and make phones ring!
Ribbit.Calls().createCall(callbackFunction,["tel:1650123456","tel:44790132345"]);
Very soon you'll be able to write widgets that logon users through the Ribbit Mobile platform too!
Have fun using the SDK, and please tell us what you think
Tim

