
Since its inception, we wanted Baato to be “developer first”. Our services needed to be easy for developers to integrate and test within their workflows, in the shortest time possible, and with tools that they’re already using. This article aims to showcase some of our work on this front by providing a brief introduction around the different client libraries that allow you to integrate Baato’s APIs into your web and mobile apps.
Baato for web development
baato-js-client
The Baato JavaScript library is designed for web application developers to integrate the Baato API into their front-end projects. It offers simple, flexible access to Baato APIs through constructors of the following form.
import Baato from "@klltech/baato-js-client";
const search = new Baato.Search()
.setApiVersion("1")
.setQuery("bal")
.setKey("YOUR_BAATO_ACCESS_TOKEN")
.doRequest()
.then(response => {
console.log(response); // search response
});
The library currently has support for the Search, Places, Reverse Search and Directions API. Detailed documentation on the Baato JS client, along with examples can be found here: @klltech/baato-js-client
Standalone JS bundle
The Baato JS library is also available as a standalone JS bundle through the UNPKG CDN. This allows you to integrate Baato’s services directly in HTML pages. All you have to do is add a <script>
tag in your document as follows.
<script src="https://www.unpkg.com/@klltech/baato-js-client@1.1.1/dist/bundle.js"></script>
Please visit our official docs to access working examples that demonstrate how you can integrate Baato APIs in your web applications.
Baato for mobile development
Creating an API interface and handling responses is always tedious in mobile development. The Java, Swift and Dart libraries are designed to simplify these tasks and speed up Baato integration in new and existing mobile applications.
Baato Java Client
The Baato Java library (hereafter referred as “javaclient”) makes it easy to integrate the Baato API into existing Android projects. The library is currently accessible through Jitpack. The project’s code is available in Github.
For more information around how to integrate and using Baato Java Client for your android projects, visit this link.
Baato Navigation SDK for Java
This library together with the ‘javaclient’ library helps to integrate turn-by-turn navigation in your Android applications. This library also provides localized navigation voice instructions in Nepali and English languages, and is easily customizable for specific language support.
For more information visit our official docs for the Baato Navigation SDK. You can also review this working example that demonstrates how to integrate turn-by-turn navigation in your android applications.
Baato Swift Library for iOS development
The Baato Swift library makes it easy to integrate the Baato API into existing iOS projects. This library is available as a CocoaPod. To integrate BaatoSwift to your project, add the following to your Podfile
.
source 'https://github.com/baato/BaatoPodSpec.git'
target '${YourApp}' do
use_frameworks!
# Pods for ${YourApp}
pod 'BaatoSwift', '~> ${LatestVersion}'
end
Further details, including code examples can be found here: https://docs.baato.io/#/v1/libraries/swift-client
Baato Dart package for Flutter projects
To make development in Flutter easier, Baato is also available as a package for the Dart programming language. For more information around how to integrate and using Baato in your Flutter projects, please visit this link.