<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aim Techno Lab</title>
    <description>The latest articles on DEV Community by Aim Techno Lab (@aimtechnolab).</description>
    <link>https://dev.to/aimtechnolab</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3970852%2F862101d5-6b7f-44aa-bdcc-0869e767dd32.jpg</url>
      <title>DEV Community: Aim Techno Lab</title>
      <link>https://dev.to/aimtechnolab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aimtechnolab"/>
    <language>en</language>
    <item>
      <title>We Built and Published an Official JavaScript SDK for Locara</title>
      <dc:creator>Aim Techno Lab</dc:creator>
      <pubDate>Sun, 07 Jun 2026 08:26:50 +0000</pubDate>
      <link>https://dev.to/aimtechnolab/we-built-and-published-an-official-javascript-sdk-for-locara-34kl</link>
      <guid>https://dev.to/aimtechnolab/we-built-and-published-an-official-javascript-sdk-for-locara-34kl</guid>
      <description>&lt;p&gt;Locara is a developer-first location data API for countries, states, and cities. We built it to make geographic data easy to consume in apps, dashboards, and backend services — and now we’ve made it even easier with an official JavaScript SDK.&lt;/p&gt;

&lt;p&gt;This release removes the friction of raw REST calls and gives developers a clean, typed experience for the most common Locara workflows.&lt;/p&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Locara provides normalized location data for developers who need countries, states, and cities in their applications. It is built for use cases like address forms, regional filtering, travel apps, and analytics dashboards.&lt;/p&gt;

&lt;p&gt;An SDK matters because it turns repetitive API plumbing into a simple client interface. Instead of copying fetch code, wiring auth headers, and handling pagination over and over, developers can install a package and start querying location data with a familiar class-based API.&lt;/p&gt;




&lt;h2&gt;
  
  
  The problem with raw REST
&lt;/h2&gt;

&lt;p&gt;Before this SDK, using Locara required writing your own fetch wrappers around the REST endpoints.&lt;/p&gt;

&lt;p&gt;That meant developers had to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;set &lt;code&gt;Authorization&lt;/code&gt; headers manually,&lt;/li&gt;
&lt;li&gt;parse JSON responses,&lt;/li&gt;
&lt;li&gt;normalize error handling,&lt;/li&gt;
&lt;li&gt;handle rate limits or unexpected HTTP status codes,&lt;/li&gt;
&lt;li&gt;and write pagination logic for list endpoints.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For teams building production apps, that boilerplate is a real distraction. It also introduces subtle bugs when different parts of the app implement the same API patterns inconsistently.&lt;/p&gt;

&lt;p&gt;The SDK removes that friction by providing a single, consistent client that manages authentication, request configuration, and response typing for you.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's in the SDK
&lt;/h2&gt;

&lt;p&gt;The new &lt;code&gt;locara-js&lt;/code&gt; package includes everything needed for modern JavaScript and TypeScript projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;locara-js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  LocaraClient
&lt;/h3&gt;

&lt;p&gt;The SDK exposes a &lt;code&gt;LocaraClient&lt;/code&gt; class that accepts options such as &lt;code&gt;apiKey&lt;/code&gt;, &lt;code&gt;baseUrl&lt;/code&gt;, and &lt;code&gt;timeout&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This makes it easy to configure the client for different environments, whether you're running in Node.js or the browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  Three resources
&lt;/h3&gt;

&lt;p&gt;The client includes three primary resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;client.countries&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;client.states&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;client.cities&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each resource is designed around the most common operations developers need to build location-based experiences.&lt;/p&gt;

&lt;h3&gt;
  
  
  TypeScript types
&lt;/h3&gt;

&lt;p&gt;We included full TypeScript typings for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Country&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;State&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;City&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PaginatedResponse&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means IDE auto-complete and compile-time validation for the shapes returned by Locara.&lt;/p&gt;

&lt;h3&gt;
  
  
  LocaraError
&lt;/h3&gt;

&lt;p&gt;The SDK also ships with a &lt;code&gt;LocaraError&lt;/code&gt; class.&lt;/p&gt;

&lt;p&gt;It exposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;status&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;message&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;code&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes it easy to distinguish API errors from other runtime issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Zero dependencies and modern output
&lt;/h3&gt;

&lt;p&gt;The package is built with zero runtime dependencies and ships as a dual output library:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ESM&lt;/li&gt;
&lt;li&gt;CJS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It supports Node 18+ and browser environments, so you can use it in server-side apps, static sites, or client-side UIs without extra bundler work.&lt;/p&gt;




&lt;h2&gt;
  
  
  Code examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;locara-js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Quick start
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;LocaraClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;locara-js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LocaraClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;loc_live_xxxx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;countries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;countries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;states&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;states&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;IN&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cities&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cities&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;US&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;CA&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Error handling
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;LocaraClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;LocaraError&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;locara-js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;country&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;countries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;XX&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="nx"&gt;LocaraError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 404&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// "Country not found."&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What's next for Locara
&lt;/h2&gt;

&lt;p&gt;We’re already working on the next SDK release.&lt;/p&gt;

&lt;p&gt;First up is a Python SDK, followed by support for postal/ZIP codes, reverse geocoding, and timezone data.&lt;/p&gt;

&lt;p&gt;For full documentation and API details, visit &lt;a href="https://www.locara.online/docs" rel="noopener noreferrer"&gt;https://www.locara.online/docs&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;If you're building with Locara, give the new JavaScript SDK a try and let us know how it fits into your workflow. We designed it to reduce integration time and make location data easier to use — feedback is welcome.&lt;/p&gt;

&lt;p&gt;Originally published at aimtechnolab.com&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>webdev</category>
      <category>npm</category>
    </item>
    <item>
      <title>We Built and Published an Official JavaScript SDK for Locara</title>
      <dc:creator>Aim Techno Lab</dc:creator>
      <pubDate>Sat, 06 Jun 2026 06:57:13 +0000</pubDate>
      <link>https://dev.to/aimtechnolab/we-built-and-published-an-official-javascript-sdk-for-locara-27f5</link>
      <guid>https://dev.to/aimtechnolab/we-built-and-published-an-official-javascript-sdk-for-locara-27f5</guid>
      <description>&lt;p&gt;Locara is a developer-first location data API for countries, states, and cities. We built it to make geographic data easy to consume in apps, dashboards, and backend services — and now we’ve made it even easier with an official JavaScript SDK.&lt;/p&gt;

&lt;p&gt;This release removes the friction of raw REST calls and gives developers a clean, typed experience for the most common Locara workflows.&lt;/p&gt;




&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Locara provides normalized location data for developers who need countries, states, and cities in their applications. It is built for use cases like address forms, regional filtering, travel apps, and analytics dashboards.&lt;/p&gt;

&lt;p&gt;An SDK matters because it turns repetitive API plumbing into a simple client interface. Instead of copying fetch code, wiring auth headers, and handling pagination over and over, developers can install a package and start querying location data with a familiar class-based API.&lt;/p&gt;




&lt;h2&gt;
  
  
  The problem with raw REST
&lt;/h2&gt;

&lt;p&gt;Before this SDK, using Locara required writing your own fetch wrappers around the REST endpoints.&lt;/p&gt;

&lt;p&gt;That meant developers had to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;set &lt;code&gt;Authorization&lt;/code&gt; headers manually,&lt;/li&gt;
&lt;li&gt;parse JSON responses,&lt;/li&gt;
&lt;li&gt;normalize error handling,&lt;/li&gt;
&lt;li&gt;handle rate limits or unexpected HTTP status codes,&lt;/li&gt;
&lt;li&gt;and write pagination logic for list endpoints.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For teams building production apps, that boilerplate is a real distraction. It also introduces subtle bugs when different parts of the app implement the same API patterns inconsistently.&lt;/p&gt;

&lt;p&gt;The SDK removes that friction by providing a single, consistent client that manages authentication, request configuration, and response typing for you.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's in the SDK
&lt;/h2&gt;

&lt;p&gt;The new &lt;code&gt;locara-js&lt;/code&gt; package includes everything needed for modern JavaScript and TypeScript projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;locara-js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  LocaraClient
&lt;/h3&gt;

&lt;p&gt;The SDK exposes a &lt;code&gt;LocaraClient&lt;/code&gt; class that accepts options such as &lt;code&gt;apiKey&lt;/code&gt;, &lt;code&gt;baseUrl&lt;/code&gt;, and &lt;code&gt;timeout&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This makes it easy to configure the client for different environments, whether you're running in Node.js or the browser.&lt;/p&gt;

&lt;h3&gt;
  
  
  Three resources
&lt;/h3&gt;

&lt;p&gt;The client includes three primary resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;client.countries&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;client.states&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;client.cities&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each resource is designed around the most common operations developers need to build location-based experiences.&lt;/p&gt;

&lt;h3&gt;
  
  
  TypeScript types
&lt;/h3&gt;

&lt;p&gt;We included full TypeScript typings for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Country&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;State&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;City&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;PaginatedResponse&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That means IDE auto-complete and compile-time validation for the shapes returned by Locara.&lt;/p&gt;

&lt;h3&gt;
  
  
  LocaraError
&lt;/h3&gt;

&lt;p&gt;The SDK also ships with a &lt;code&gt;LocaraError&lt;/code&gt; class.&lt;/p&gt;

&lt;p&gt;It exposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;status&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;message&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;code&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes it easy to distinguish API errors from other runtime issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Zero dependencies and modern output
&lt;/h3&gt;

&lt;p&gt;The package is built with zero runtime dependencies and ships as a dual output library:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;ESM&lt;/li&gt;
&lt;li&gt;CJS&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It supports Node 18+ and browser environments, so you can use it in server-side apps, static sites, or client-side UIs without extra bundler work.&lt;/p&gt;




&lt;h2&gt;
  
  
  Code examples
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;locara-js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Quick start
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;LocaraClient&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;locara-js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;LocaraClient&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;apiKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;loc_live_xxxx&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;countries&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;countries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;states&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;states&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;IN&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cities&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cities&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;list&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;US&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;CA&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Error handling
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;LocaraClient&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;LocaraError&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;locara-js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;country&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;countries&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;XX&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt; &lt;span class="k"&gt;instanceof&lt;/span&gt; &lt;span class="nx"&gt;LocaraError&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// 404&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// "Country not found."&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  What's next for Locara
&lt;/h2&gt;

&lt;p&gt;We’re already working on the next SDK release.&lt;/p&gt;

&lt;p&gt;First up is a Python SDK, followed by support for postal/ZIP codes, reverse geocoding, and timezone data.&lt;/p&gt;

&lt;p&gt;For full documentation and API details, visit &lt;a href="https://www.locara.online/docs" rel="noopener noreferrer"&gt;https://www.locara.online/docs&lt;/a&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Closing
&lt;/h2&gt;

&lt;p&gt;If you're building with Locara, give the new JavaScript SDK a try and let us know how it fits into your workflow. We designed it to reduce integration time and make location data easier to use — feedback is welcome.&lt;/p&gt;

&lt;p&gt;Originally published at aimtechnolab.com&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>npm</category>
      <category>webapp</category>
    </item>
  </channel>
</rss>
