SDKs

Javascript (Node/Browser)

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

import { Mercoa, MercoaClient } from "@mercoa/javascript"
// If using on the server with Node.js
const mercoa = new MercoaClient({
token: 'YOUR_API_KEY',
});
// If using in the browser
const mercoa = new MercoaClient({
token: 'YOUR_CLIENT_JWT',
});
const entity = mercoa.entity.get("YOUR_ENTITY_ID")
console.log(entity)