Skip to main content

npm SDK Installation

The Artos npm SDK (@artosai/sdk) provides a lightweight JavaScript/TypeScript client for integrating Artos functionality into your application.

Prerequisites

Before you begin, ensure you have:
  • Node.js version 16.0.0 or higher
  • npm or yarn package manager
  • An Artos API access token (provided by your Artos account manager)
  • A GitHub Packages access token (provided by Artos for SDK installation)

Step 1: Configure npm to use GitHub Packages

Create or update your project’s .npmrc file in the root of your project:
Add the following lines to .npmrc:
Replace YOUR_GITHUB_PACKAGES_TOKEN with the token provided by Artos.
Using environment variables (recommended for CI/CD and security):
Then set the environment variable before installing:
Do not use npm login with GitHub Packages - it is not supported. Always use the .npmrc file method.

Step 2: Install the SDK

Or with yarn:

Verify Installation

Quick Start

Here’s a minimal example to get you started:

Troubleshooting

”Cannot find module ‘@artosai/sdk’”

Cause: The package is not installed or npm is not configured correctly. Solution:
  1. Verify your .npmrc file is in the project root
  2. Check that the GitHub Packages token is correct
  3. Run npm install @artosai/sdk again

Network Timeouts

Cause: Network connectivity issues or server unavailability. Solution:
  1. Check your internet connection
  2. Verify the API base URL is correct (must include https://)
  3. Implement retry logic for transient failures (see Error Handling)