Skip to main content

NPM Installation Guide

This guide covers NPM installation for React applications. For non-React applications or simple script tag integration, see the CDN Installation Guide.

Installation Methods

The Moss SDK offers two installation methods:
MethodBest ForSetup Complexity
CDN InstallationNon-React apps, simple integration⭐ Simple
NPM Installation (this guide)React apps, full TypeScript support⭐⭐ Moderate

Prerequisites

  • A React application (v17 or higher)
  • An active Node.js environment (v18 or higher recommended)

1. Installing the SDK

The Moss SDK is published on the public NPM registry. No authentication or .npmrc configuration is required.
npm install @viamoss/moss-sdk
or
pnpm add @viamoss/moss-sdk
or
yarn add @viamoss/moss-sdk

2. Integration

After installation, you can integrate the SDK into your application as described in the Quickstart Guide.

Alternative: CDN Installation

If you prefer a simpler setup or don’t use React, consider the CDN Installation method:
<!-- One-line installation -->
<script src="https://cdn.moss.ai/moss-sdk@latest?applicationId=YOUR_APP_ID"></script>
This method requires no build tools, package managers, or React dependencies.