navan-sdk-patterns

Featured

Build a typed API wrapper around Navan REST endpoints since no official SDK exists. Use when you need production-grade API access with auto token refresh, retry logic, and typed responses. Trigger with "navan sdk patterns", "navan api wrapper", "navan client class", "navan typed client".

AI & Automation 2,266 stars 315 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

# Navan SDK Patterns ## Overview Build a typed API wrapper around Navan REST endpoints since no official SDK exists (`@navan/sdk` is not a real package). These patterns provide automatic token lifecycle management, typed responses, retry middleware, and centralized error handling. **Purpose:** Create a reusable NavanAPI class encapsulating authentication, request handling, and error recovery. ## Prerequisites - Completed `navan-install-auth` with working OAuth 2.0 credentials - TypeScript 5+ project with `dotenv` installed - Familiarity with the Navan endpoints from `navan-hello-world` ## Instructions ### Step 1: Define Response Interfaces Type the known API response shapes so every call returns structured data: ```typescript // navan-types.ts export interface NavanTrip { uuid: string; traveler_name: string; origin: string; destination: string; departure_date: string; return_date: string; booking_status: string; booking_type: 'flight' | 'hotel' | 'car'; } export interface NavanUser { id: string; email: string; first_name: string; last_name: string; department: string; role: string; } export interface NavanApiError { status: number; message: string; endpoint: string; timestamp: string; } ``` ### Step 2: Build the NavanAPI Wrapper Class Create a singleton client with automatic token management: ```typescript // navan-client.ts import 'dotenv/config'; import type { NavanTrip, NavanUser, NavanApiError } from './navan-types'; expo...

Details

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

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

navan-hello-world

Make your first Navan API call to retrieve trip and user data. Use when verifying a new Navan integration works end-to-end after auth setup. Trigger with "navan hello world", "navan example", "test navan api", "first navan call".

2,266 Updated today
jeremylongshore
AI & Automation Featured

navan-install-auth

Set up OAuth 2.0 authentication for the Navan REST API. Use when configuring a new Navan integration or rotating API credentials. Trigger with "install navan", "setup navan auth", "navan credentials", "navan oauth".

2,266 Updated today
jeremylongshore
AI & Automation Solid

vercel-sdk-patterns

Production-ready Vercel REST API patterns with typed fetch wrappers and error handling. Use when integrating with the Vercel API programmatically, building deployment tools, or establishing team coding standards for Vercel API calls. Trigger with phrases like "vercel SDK patterns", "vercel API wrapper", "vercel REST API client", "vercel best practices", "idiomatic vercel API".

2,266 Updated today
jeremylongshore
AI & Automation Featured

navan-observability

Use when setting up monitoring, logging, and alerting for Navan API integrations in production environments. Trigger with "navan observability" or "navan monitoring" or "navan api dashboards".

2,266 Updated today
jeremylongshore
AI & Automation Featured

klaviyo-sdk-patterns

Apply production-ready Klaviyo SDK patterns for the klaviyo-api package. Use when implementing Klaviyo integrations, refactoring SDK usage, or establishing team coding standards for Klaviyo API calls. Trigger with phrases like "klaviyo SDK patterns", "klaviyo best practices", "klaviyo code patterns", "idiomatic klaviyo", "klaviyo wrapper".

2,266 Updated today
jeremylongshore