# @local-logic/client

> The Local Logic Client library provides a JavaScript entry point to Local Logic Scores, Points of Interest, Demographics, Schools, Profiles, and Geographies.

Latest version **1.10.40** (published 2026-09-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install @local-logic/client
pnpm add @local-logic/client
yarn add @local-logic/client
bun add @local-logic/client
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.10.40 |
| Published | 2026-09-14 |
| First published | 2022-02-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 348.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | locallogicit, cmburcus, amurphyll, bradleyexton, katialira |

## Links

- npm: https://www.npmjs.com/package/@local-logic/client
- Repository: https://github.com/nexmoov/client-library
- Homepage: https://github.com/nexmoov/client-library#readme
- Issues: https://github.com/nexmoov/client-library/issues
- npm.io page: https://npm.io/package/@local-logic/client

## Dependencies (1)

- [yup](https://npm.io/package/yup.md) ^1.7.0

## Recent versions

- 1.10.40 (latest) — 2026-09-14
- 1.0.0-beta.15 (beta) — 2022-10-26
- 1.10.39 — 2026-08-12
- 1.10.38 — 2026-07-30
- 1.10.37 — 2026-06-08
- 1.10.36 — 2026-05-06
- 1.10.35 — 2026-04-08
- 1.10.34 — 2026-04-07
- 1.10.33 — 2026-03-31
- 1.10.32 — 2026-03-24
- 1.10.31 — 2026-03-09
- 1.10.30 — 2026-03-02
- 1.10.29 — 2026-02-18
- 1.10.28 — 2026-02-10
- 1.10.27 — 2026-01-28
- … 75 more at https://npm.io/package/@local-logic/client/versions

## README

# Local Logic Client

The Local Logic Client library provides a JavaScript entry point to Local Logic Scores, Points of Interest, Demographics, Schools, Profiles, and Geographies.

## Installation

Npm:

```
npm install @local-logic/client
```

Yarn:

```
yarn add @local-logic/client
```

Pnpm:

```
pnpm add @local-logic/client
```

## Getting Started

To use the library, start by creating a new instance by invoking `LocalLogicClient` with your `apiKey`. You can generate a apiKey using the [`locallogic.co/oauth/apiKey` API](api.locallogic.co/oauth/apiKey).

Example:

```ts
  import LocalLogicClient, { Scores } from "@local-logic/client";

  ...

  const client = LocalLogicClient("<apiKey>");

  let scores: Scores | undefined;

  try {
    scores = await client.getScores({
      lat: 45.532970,
      lng: -73.585600,
      include: ["groceries"]
    });
  } catch (e) {
    // Handle error
  }
```

## Methods

### `getPois(params: Params) => Promise<POIs>`

### `getScores(params: Params) => Promise<Scores>`

### `getSchools(params: Params) => Promise<Schools>`

### `getGeographies(params: Params) => Promise<Geographies>`

### `getDemographics(params: Params) => Promise<Demographics>`

### `getProfiles(params: Params) => Promise<Profiles>`

### `getLocation(params: Params) => Promise<Location>`

## Error Handling

You can catch errors by wrapping your method invokations in `try / catch`. You can handle your errors generically, or if you require more granular control you can make use of the provided typeguards `isRequestError` and `isValidationError`.

Example:

```ts
import LocalLogicClient, {
  isRequestError,
  isValidationError,
} from "@local-logic/client";

try {
  // Call method
} catch (e) {
  if (isRequestError(e)) {
    // Handle request errors
  }

  if (isValidationError(e)) {
    // Handle validation errors
  }

  // Handle all other errors
}
```

## Typescript

`@local-logic/client` provides type definitions and typeguards.

---
_Source: https://npm.io/package/@local-logic/client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
