@scoova/geocoding-react-native
v1.1.3
Published
React Native build of @scoova/geocoding — Geocoding client for api.scoo-va.info/api/v1/geocoding. Pure TypeScript, no native modules.
Maintainers
Readme
@scoova/geocoding-react-native
React Native build of @scoova/geocoding.
Pure TypeScript, no native modules — uses the global fetch shipped with
React Native.
npm install @scoova/geocoding-react-native
# or: yarn add @scoova/geocoding-react-nativeimport { GeocodingClient, featureLabel } from '@scoova/geocoding-react-native';
const client = new GeocodingClient({
apiKey: 'sk_live_…', // omit → falls back to 'demo' (rate-limited)
locale: 'fr',
});
const suggestions = await client.autocomplete('Tour Eif', {
focusPoint: { lat: 48.85, lon: 2.29 },
size: 5,
});
const reverse = await client.reverse(48.8584, 2.2945, { size: 1 });
const batch = await client.batch([
{ id: 'a', text: 'Times Square' },
{ id: 'b', lat: 40.7484, lon: -73.9857 },
]);
for (const row of batch.results) {
console.log(row.id, row.top ? featureLabel(row.top) : row.error);
}Client options
| option | type | default | notes |
| ---------------- | -------- | ---------------------------------- | -------------------------------------- |
| apiKey | string | SCOOVA_API_KEY env, then demo | sent as X-API-Key |
| baseUrl | string | https://api.scoo-va.info/api/v1/geocoding | |
| locale | string | 'en' | ?locale= + Accept-Language |
| lang | string | — | legacy alias for locale |
| androidPackage | string | — | X-Android-Package (key restriction) |
| iosBundleId | string | — | X-Ios-Bundle-Identifier |
| fetch | fetch | RN global | for tests / custom transports |
API
search(text, options)—/v1/searchautocomplete(text, options)—/v1/autocompletereverse(lat, lon, options)—/v1/reverseplace(ids)—/v1/placesearchStructured(query, options)—/v1/search/structuredbatch(queries)—/v1/batch(POST, max 100 items)
Tests
npm testLicense
Apache-2.0 — see LICENSE.
