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:
.npmrc:
Replace
YOUR_GITHUB_PACKAGES_TOKEN with the token provided by Artos.Step 2: Install the SDK
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:- Verify your
.npmrcfile is in the project root - Check that the GitHub Packages token is correct
- Run
npm install @artosai/sdkagain
Network Timeouts
Cause: Network connectivity issues or server unavailability. Solution:- Check your internet connection
- Verify the API base URL is correct (must include
https://) - Implement retry logic for transient failures (see Error Handling)