exa-sdk-patterns

Featured

Apply production-ready exa-js SDK patterns with type safety, singletons, and wrappers. Use when implementing Exa integrations, refactoring SDK usage, or establishing team coding standards for Exa. Trigger with phrases like "exa SDK patterns", "exa best practices", "exa code patterns", "idiomatic exa", "exa wrapper".

AI & Automation 2,944 stars 440 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Exa SDK Patterns ## Overview Production-ready patterns for the `exa-js` SDK. Covers client singletons, typed wrappers, error handling, retry logic, and response validation for real Exa API methods. ## Prerequisites - `exa-js` installed and `EXA_API_KEY` configured - TypeScript project with strict mode - Familiarity with async/await and error handling ## Instructions ### Step 1: Client Singleton ```typescript // src/exa/client.ts import Exa from "exa-js"; let instance: Exa | null = null; export function getExa(): Exa { if (!instance) { const apiKey = process.env.EXA_API_KEY; if (!apiKey) { throw new Error("EXA_API_KEY not set. Get one at https://dashboard.exa.ai"); } instance = new Exa(apiKey); } return instance; } ``` ### Step 2: Typed Search Wrapper ```typescript // src/exa/search.ts import Exa from "exa-js"; import { getExa } from "./client"; interface ExaSearchOptions { type?: "auto" | "neural" | "keyword" | "fast" | "instant" | "deep" | "deep-reasoning"; numResults?: number; includeDomains?: string[]; excludeDomains?: string[]; startPublishedDate?: string; endPublishedDate?: string; category?: "company" | "research paper" | "news" | "tweet" | "personal site" | "financial report" | "people"; includeText?: string[]; excludeText?: string[]; } interface ExaContentsOptions { text?: boolean | { maxCharacters?: number; includeHtmlTags?: boolean }; highlights?: boolean | { maxCharacters?: number; query?: string }; sum...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category