Skip to main content

Package Manager

Install the SDK using your preferred package manager:

Requirements

  • Node.js 16+ or modern browser environment
  • TypeScript 4.5+ (optional, for TypeScript projects)

API Key

You’ll need a Context7 API key to use the SDK. Get one from context7.com. API keys follow the format: ctx7sk-...

Environment Setup

Set your API key as an environment variable:
Then initialize the client without passing the key:

Direct Configuration

Alternatively, pass the API key directly to the constructor:
Never commit API keys to version control. Use environment variables or secure secret management.

TypeScript Support

The SDK is written in TypeScript and includes full type definitions. No additional @types packages are needed.

Verification

Verify your installation with a quick test:

Next Steps

Client Configuration

Learn how to initialize and configure the Context7 client