Install Dictionary SDK

Add the Dictionary SDK to your project in under 30 seconds. Supports Node.js, Python, PHP, Java, and more.

📌 Prerequisites Requires Node.js 18+, Python 3.9+, or equivalent runtime. You'll also need a free API key from the Dictionary Dashboard. Get yours here.

Install via Package Manager

Select your language or platform to see the installation command:

Terminal
# Using npm npm install @dictionary/sdk # Using yarn yarn add @dictionary/sdk # Using pnpm pnpm add @dictionary/sdk

Verify installation by checking your package.json dependencies.

Terminal
# Using pip pip install dictionary-sdk # Using pipx (recommended for CLI tools) pipx install dictionary-sdk

Requires Python 3.9 or higher. We recommend using a virtual environment for development.

HTTP / cURL
# Dictionary SDK works natively with cURL # No installation required curl -X GET \
https://api.dictionary.com/v2/lookup?word=hello \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"

Great for prototyping, CI/CD scripts, or serverless environments without package managers.

Terminal
# Using Composer composer require dictionary/sdk # Load via autoloader in your project require 'vendor/autoload.php';

Compatible with PHP 8.0+. Supports Laravel, Symfony, and vanilla PHP setups.

pom.xml
<!-- Add to your pom.xml dependencies --> <dependency> <groupId>com.dictionary</groupId> <artifactId>dictionary-sdk-java</artifactId> <version>2.4.1</version> </dependency>

Supports Java 11+ and is fully compatible with Spring Boot, Quarkus, and Micronaut.

Configure & Initialize

After installation, initialize the client with your API key. We recommend using environment variables for security.

  1. Set your API Key

    Export your key in your environment or add it to your .env file:

    .env
    DICTIONARY_API_KEY="sk_test_51abc123def456..." DICTIONARY_ENV="development"
  2. Instantiate the Client

    Import and initialize the SDK in your entry point:

    JavaScript
    import { Dictionary } from '@dictionary/sdk'; import { config } from 'dotenv'; config(); const dictionary = new Dictionary({ apiKey: process.env.DICTIONARY_API_KEY, timeout: 5000, retries: 2 }); // Test connection const health = await dictionary.health(); console.log(`SDK Status:`, health.status); // "connected"

Troubleshooting

⚠️ Module not found errors Run npm install or clear your cache with npm cache clean --force if the package fails to resolve.
🔑 Authentication failed (401) Ensure your API key is correctly formatted without extra spaces. Test keys are prefixed with sk_test_ and production keys with sk_live_.