Skip to content
TarekyDocs
Console

JavaScript SDK

A map app built on the API: places nearby in a sidebar beside the mapA map app built on the API: places nearby in a sidebar beside the map
Terminal window
npm install @tareky/sdk
import { createTareky, staticMapUrl, styleUrl } from '@tareky/sdk'
const tareky = createTareky({ key: 'tareky_pk_…' })
const { data, error } = await tareky.GET('/v1/locations/geocode', {
params: { query: { q: 'المنصور', limit: 5 } },
})
if (error) console.log(error.error.code) // see Errors
  • The client is generated from the same OpenAPI spec as the reference, so every path, parameter and response is typed.
  • styleUrl('light', { key }) gives a map style URL, and staticMapUrl({ … }) a static image URL.
  • Works in browsers and in Node 18 and later.