Chord OMS
...
Developer Tools
React

Quick Start

3min

Installing

In order to install the necessary Chord packages, follow the guide below on how to configure your package manager to access Chord's packages.

After completing the steps in the guide above, you can install the package and its peer dependencies:

yarn
npm


Developing

Your application needs to be wrapped in the Function: ChordProvider component. react-autonomy keeps track of your application state and makes it available to components. For example, what is currently in a user's cart is automatically persisted. <ChordProvider> makes the state available throughout your application.

<ChordProvider> requires a configuration object with information about your storefront. Here's an example:

The config object requires these keys:

Name

Type

Description

brandName

String

The store's name.

currency

String

The store's currency. For example, USD.

domain

String

The base URL of the OMS API to use for requests. For example, https://my-store.assembly-api.com.

locale

String

The store's locale. For example, en-US.

omsId

String

A unique identifier generated by Chord during provisioning.

storeId

String

A unique identifier generated by Chord during provisioning.

tenantId

String

A unique identifier generated by Chord during provisioning.

Once your application is wrapped in the <ChordProvider> component, you can use SDK methods throughout your code. For example, here's a React component for adding an item to the cart:



Updated 28 Jul 2023
Did this page help you?