Installation

Detailed guide for installing and configuring the Cencori SDK in your JavaScript or TypeScript project.

System Requirements

Before installing Cencori, ensure your system meets these requirements:

  • Node.js: Version 18.0.0 or higher
  • Package Manager: npm 8+, yarn 1.22+, or pnpm 7+
  • TypeScript: Version 4.5+ (optional but recommended)
  • Operating System: Windows, macOS, or Linux

Package Installation

Install the Cencori SDK using your preferred package manager:

Using npm

terminal

Using yarn

terminal

Using pnpm

terminal

Note: The package name is cencori, not @cencori/sdk. Make sure to use the correct package name when installing.

Environment Setup

Create a .env file in your project root to store your API credentials:

.env

Security: Never commit your .env file to version control. Add it to your .gitignore file to prevent accidental exposure of your API keys.

SDK Initialization

Create a Cencori client instance in your application:

Basic Configuration

lib/cencori.ts

Advanced Configuration

lib/cencori.ts

Configuration Options

The Cencori SDK accepts the following configuration options:

  • apiKey (required): Your Cencori API key from the dashboard
  • projectId (required): Your project ID from the dashboard
  • baseURL (optional): Custom API endpoint URL
  • timeout (optional): Request timeout in milliseconds
  • debug (optional): Enable detailed logging for debugging
  • headers (optional): Additional HTTP headers for all requests

Verify Installation

Test your installation by making a simple request:

test-cencori.ts

Run this test script with:

terminal

Troubleshooting

Common installation issues and their solutions:

Module Not Found Error

If you see Cannot find module 'cencori', verify the package is installed:

terminal

If not found, reinstall the package.

Authentication Errors

If you receive authentication errors, verify your API key and project ID are correct and properly loaded from environment variables.

TypeScript Errors

Ensure your TypeScript version is 4.5 or higher. The Cencori SDK includes full TypeScript definitions.

Network Timeouts

If requests are timing out, increase the timeout value in your configuration or check your network connectivity.

Next Steps

Now that you've installed Cencori, here's what to do next: