For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inBook a demo
  • SDKs
    • Javascript (Node/Browser)
    • Python
    • Go
    • Java
Logo
Sign inBook a demo
On this page
  • Installation
  • Initialization
SDKs

Javascript (Node/Browser)

Was this page helpful?

Python

Next
Built with

If you’re working with the Browser or Node.js, the official @mercoa/javascript package is the easiest way to interact with the Mercoa API.

The SDK is written in TypeScript and includes type definitions for all resources, requests, and responses.

Installation

$npm install --save @mercoa/javascript
$# or
$yarn add @mercoa/javascript

Initialization

1import { Mercoa, MercoaClient } from "@mercoa/javascript"
2
3// If using on the server with Node.js
4const mercoa = new MercoaClient({
5 token: 'YOUR_API_KEY',
6});
7
8// If using in the browser
9const mercoa = new MercoaClient({
10 token: 'YOUR_CLIENT_JWT',
11});
12
13const entity = mercoa.entity.get("YOUR_ENTITY_ID")
14
15console.log(entity)