
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
@concord-consortium/lara-interactive-api
Advanced tools
A TypeScript-based API for the LARA Interactive API. This also includes all the types for the API which are shared with the server-side Typescript files that implement the LARA-side of the API.
NOTE: this file (in /docs) is auto-generated as part of the lara-typescript build using TypeDoc
by combining the API client's readme file with auto-generated output. If you wish to edit this document please edit
lara-typescript/src/interactive-api-client/README.md.
First install the package:
npm i --save @concord-consortium/lara-interactive-api
Then import it into your code:
import * as interactiveApi from "@concord-consortium/lara-interactive-api"
or import just necessary functions:
import { setHeight, useInteractiveState } from "@concord-consortium/lara-interactive-api"
the API is compiled TypeScript and includes the typings in .d.ts files in the package. These typings are
automatically loaded by the TypeScript compiler so you do now need to install a separate @types/... package.
All the Interactive API helpers are exported as single functions. For example;
import { setHeight, setHint, getAuthInfo } from "@concord-consortium/lara-interactive-api"
Some functions might accept types, e.g. getInteractiveState<InteractiveState>(). When there are more types accepted,
the order of the type variables is important, it is InteractiveState, AuthoredState, DialogState, and
IGlobalInteractiveState. If you do wish to skip a type variable just use {} in its place and any type variable
left off on the end defaults to {}, eg:
const getInitInteractiveMessage<IInteractiveState, {}, {}, IGlobalInteractiveState>();
If you are using React you will instead want to the use the hooks which wrap the API functions in a more easily
used form. All the hooks start with use prefix. To use the hook first import it:
import { useInteractiveState } from "@concord-consortium/lara-interactive-api"
and then call the hook using your type variables in your React component.
Here is a minimal example of a useInteractiveState hook:
const { interactiveState, setInteractiveState } = useInteractiveState<IInteractiveState>();
...
const handleButtonClick = () => {
// Functional update, usually safer option:
setInteractiveState((prevState: InteractiveState) => ({ numButtonPresses: prevState.numButtonPresses + 1 }));
// Or regular update that can cause troubles when new state is based on the previous one:
// setInteractiveState({ numButtonPresses: interactiveState.numButtonPresses + 1 });
}
...
<button onClick={handleButtonClick}>{interactiveState.numButtonPresses}</button>
Calling the setInteractiveState method returned by the hook will both update the state held inside the hook and
also send the message to LARA. This means that calling setInteractiveState will trigger a new React render of your
components that use the useInteractiveState hook.
The same applies to other state-based hooks and their setters:
useAuthoredStateuseGlobalInteractiveStateFAQs
LARA Interactive API client and types
We found that @concord-consortium/lara-interactive-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.