Skip to content

Local Content (New)

Available in the US and Canada

The Local Content SDK displays scores and points of interest for a given location. It can be added to any property listing in Canada and the United States.

Screenshot of new Local Content SDK's onboarding interface

Getting started


First, install the entry script with npm, yarn, or pnpm:

npm i --save @local-logic/sdks-js
yarn add @local-logic/sdks-js
pnpm add @local-logic/sdks-js

The script is also available in umd and es format from the Local Logic CDN:<VERSION>/index.<FORMAT>.js

<VERSION> is the latest script version number (which you can find on npm), and <FORMAT> is either umd or es.



Step 1: Instantiate an LLSDKsJS instance

Import LLSDKsJS and create a new localLogicSDK instance. If you installed LLSDKsJS using a script tag, you must access it from the window object.

import LLSDKsJS from "@local-logic/sdks-js";
const localLogicSDK = LLSDKsJS(
// Your API key or token

The new Local Content SDK does not support API keys from the legacy version. If you are migrating, please reach out to Local Logic support to get your new key.

You can authenticate your SDK using an API key or OAuth token. The method you choose depends on your environment; if your page is using server-side rendering (SSR), the OAuth token may be preferrable. If you have a single-page application (SPA), you will likely want to use the API key since the CLIENT_SECRET needed to generate the OAuth token should never be exposed in a client-side environment.

If you authenticate using the token you need to prefix it with Bearer.

Step 2: Instantiate a Local Content instance

Next, create an instance of Local Content. You must define a container element for it to render into.

// Define a container element
const container = document.createElement("div"); = `
height: 550px;
width: 100vw;
display: flex;
const mySiteLocation = {
lat: 37.8,
lng: -122.4
localLogicSDK.create("local-content", container, {
marker: mySiteLocation,
You can set the container dimensions to whatever you like. However, for the best user experience we recommend a minimum height and width of 550 and 300 pixels, respectively.

React applications

The SDKs are designed to work with React and other declarative frameworks.


import { useRef, useEffect } from "react";
import LLSDKsJS from "@local-logic/sdks-js";
const localLogicSDK = LLSDKsJS(<API_KEY>);
function MyLocalContentComponent() {
const containerRef = useRef(null);
useEffect(() => {
if (!containerRef.current) {
const myLocation = {
lat: 45.5282164,
lng: -73.5978527,
const localContent = localLogicSDK.create(
containerRef.current, {
marker: myLocation,
// It is important to destroy the Local Content instance when the component is unmounted.
return () => {
}, []);
return (
height: "100vh",
width: "100vw",
export default MyLocalContentComponent;


Local Logic SDKs support visual customization using the Appearance API, which allows you to match the look of the SDK to your brand.


The SDKs currently offer two themes out of the box: day and night. The default mode is day, but you may wish to use the night theme if your application supports a dark mode.

const localLogicSDK = LLSDKsJS(
appearance: { theme: "night" }


The entire theme can be further customized using the variables option.

The following example changes the primary color, font, and gives the UI a more rounded appearance.

const localLogicSDK = LLSDKsJS(
appearance: {
variables: {
"--ll-color-primary": "#fd3958",
"--ll-color-primary-variant1": "#d5405b",
"--ll-border-radius-small": "8px",
"--ll-border-radius-medium": "16px",
"--ll-font-family": "Avenir, sans-serif",

Screenshot of new Local Content SDK's onboarding interface

Commonly used variables

--ll-color-primaryThe primary brand color.
--ll-color-primary-variant1A slightly darker version of the primary brand colour. This variable should always be changed in conjunction with --ll-color-primary.
--ll-font-familyChanges the font family used throughout the SDKs. Currently, the SDKs only support system fonts. This value should always include a fallback font family, ex. Inter, sans-serif.
--ll-font-size-baseUsed to scale the font size up or down.
--ll-border-radius-smallUsed to adjust the border radius for small UI elements (buttons, tags, etc).
--ll-border-radius-mediumUsed to adjust the border radius for large UI elements (containers, etc).
--ll-spacing-base-unitUsed to scale the overall padding of the SDKs.
Less commonly used variables
  • --ll-color-surface
  • --ll-color-surface-variant1
  • --ll-color-surface-variant2
  • --ll-color-on-primary
  • --ll-color-on-primary-variant1
  • --ll-color-on-background
  • --ll-color-on-background-variant1
  • --ll-color-on-surface
  • --ll-color-on-surface-variant1
  • --ll-color-placeholder
  • --ll-color-disabled
  • --ll-color-border
  • --ll-shadow-small
  • --ll-shadow-medium
  • --ll-spacing-auto
  • --ll-spacing-base-unit
  • --ll-spacing-xx-small
  • --ll-spacing-x-small
  • --ll-spacing-small
  • --ll-spacing-medium
  • --ll-spacing-large
  • --ll-spacing-x-large
  • --ll-spacing-xx-large
  • --ll-spacing-xxx-large
  • --ll-font-size-h1
  • --ll-font-size-h2
  • --ll-font-size-h3
  • --ll-font-size-h4
  • --ll-font-size-h5
  • --ll-font-size-h6
  • --ll-font-size-p
  • --ll-font-size-caption-1
  • --ll-font-size-caption-2
  • --ll-font-weight-light
  • --ll-font-weight-normal
  • --ll-font-weight-medium
  • --ll-font-weight-bold

Migrating from Local Content (Legacy)

The new Local Content SDK has been rebuilt from the ground up. To make the application more scalable, the SDK API has changed, and is not backwards compatible with the legacy Local Content. Clients migrating from the old version will thus need to remove old code, and re-integrate using the instructions above.

Step 1: Remove Local Logic script tag

Find the line in your codebase where you are loading the Local Logic SDK script. It will likely be next to the closing </body> tag. You can also search for in your codebase.

Before you delete the code make a note of the function name assigned to callback=. If you followed our documentation it is probably called initLocallogic.

Step 2: Delete initLocallogic

Find and delete the function in your codebase you identified in Step 1.

Step 3: Get your new API Key

API keys used in the legacy Local Content are not compatible with the new Local Content. To get a new key please reach out to Local Logic support.

Step 4: Install new SDKs

You can now follow the documentation for the new SDKs outlined above.

Browser support

The SDKs are configured with to support these browsers.


The SDKs are designed to receive most new changes (non-breaking features and bug fixes) without the need for a developer to manually update the script.


Local Logic SDKs JS comes packaged with TypeScript declarations.


A full list of configuration options for Local Content is available here.


Q: How do I change the language of the SDK?

A: You can change the language by specifying locale in the LLSDKsJS options. The supported options are "en" and "fr".

const localContent = localLogicSDK.create(
containerRef.current, {
..., // Other config options here

Q: How do I prevent accidental map zooming on mobile devices?

A: A common problem in mobile maps is when a user inadvertently zooms into a map when scrolls down the page. We recommend solving this by passing the cooperativeGestures option to the Local Content SDK. This option will prevent 1 finger map zooming in favour of pinch to zoom.

const localContent = localLogicSDK.create(
containerRef.current, {
..., // Other config options here
cooperativeGestures: true

Q: How do I disable lazy load?

A: Lazy loading is enabled by default. In some situations, you may want to disable lazy loading or control lazy loading with your own scripts.

To disable lazy load, pass lazy: false to the renderOptions parameter.

const localContent = localLogicSDK.create(
{ ... },
// renderOptions
lazy: false
© Local Logic 2023