{"_id":"@airevolabs/evalmatch-sdk","name":"@airevolabs/evalmatch-sdk","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@airevolabs/evalmatch-sdk","version":"1.0.0","description":"TypeScript SDK for EvalMatch API - AI-powered recruitment platform","publishConfig":{"access":"public"},"sideEffects":false,"main":"dist/index.js","module":"dist/index.mjs","browser":"dist/index.mjs","types":"dist/index.d.ts","unpkg":"dist/index.global.js","jsdelivr":"dist/index.global.js","exports":{".":{"types":"./dist/index.d.ts","browser":"./dist/index.mjs","import":"./dist/index.mjs","require":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format cjs,esm,iife --dts --clean --minify --treeshake --sourcemap --global-name EvalMatchSDK","dev":"tsup src/index.ts --format cjs,esm --dts --watch","test":"vitest run","test:watch":"vitest","test:ui":"vitest --ui","test:coverage":"vitest run --coverage","lint":"eslint src/**/*.ts --no-warn-ignored","typecheck":"tsc --noEmit","prepublishOnly":"npm run test && npm run build","generate:types":"openapi-ts -i ../../docs/api/openapi.json -o src/generated -c @hey-api/client-axios"},"keywords":["evalmatch","recruitment","ai","resume","analysis","typescript","sdk","api-client"],"author":{"name":"AiRevoLabs","email":"hello@airevolabs.co.in"},"license":"SEE LICENSE IN LICENSE","repository":{"type":"git","url":"git+https://github.com/puneetrinity/Evalmatch.git","directory":"sdks/typescript"},"homepage":"https://evalmatch.app","bugs":{"url":"https://github.com/puneetrinity/Evalmatch/issues"},"engines":{"node":">=18.0.0"},"dependencies":{"axios":"^1.7.7","form-data":"^4.0.4"},"peerDependencies":{"firebase":">=10.0.0"},"devDependencies":{"@hey-api/openapi-ts":"^0.83.1","@types/axios":"^0.9.36","@types/node":"^20.0.0","@typescript-eslint/eslint-plugin":"^7.0.0","@typescript-eslint/parser":"^7.0.0","@vitest/coverage-v8":"^3.2.4","@vitest/ui":"^3.2.4","eslint":"^8.0.0","firebase-admin":"^13.4.0","jsdom":"^26.1.0","msw":"^2.10.5","tsup":"^8.0.0","typescript":"^5.0.0","vitest":"^3.2.4"},"_id":"@airevolabs/evalmatch-sdk@1.0.0","gitHead":"397e9f8308fc3efcb47736af960392e0afdbc2f9","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-O1xpzQqStKNQnUM6isJTbqOJHzZK26zmwUwtd41kQAjpWu1pLwAMJlaKW8EfwlGNgA20bTeILcH/FLG2fo7sGw==","shasum":"068aad09b212d29f29391cd78b3bb3c4804e802d","tarball":"https://registry.npmjs.org/@airevolabs/evalmatch-sdk/-/evalmatch-sdk-1.0.0.tgz","fileCount":12,"unpackedSize":1725240,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICMzOdsOslTAUW+7kqWcO2pIWifOggtxQLCHpgH7YpLmAiBh5Ma7F5fmIMmopQiiK5pDPvo7Baz5+a6EH87z0NeOmQ=="}]},"_npmUser":{"name":"airevolabs","email":"hello@airevolabs.co.in"},"directories":{},"maintainers":[{"name":"airevolabs","email":"hello@airevolabs.co.in"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/evalmatch-sdk_1.0.0_1758642432808_0.9877680553268708"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-23T15:47:12.692Z","1.0.0":"2025-09-23T15:47:13.035Z","modified":"2025-09-23T15:47:13.318Z"},"maintainers":[{"name":"airevolabs","email":"hello@airevolabs.co.in"}],"description":"TypeScript SDK for EvalMatch API - AI-powered recruitment platform","homepage":"https://evalmatch.app","keywords":["evalmatch","recruitment","ai","resume","analysis","typescript","sdk","api-client"],"repository":{"type":"git","url":"git+https://github.com/puneetrinity/Evalmatch.git","directory":"sdks/typescript"},"author":{"name":"AiRevoLabs","email":"hello@airevolabs.co.in"},"bugs":{"url":"https://github.com/puneetrinity/Evalmatch/issues"},"license":"SEE LICENSE IN LICENSE","readme":"# EvalMatch TypeScript SDK\n\nOfficial TypeScript SDK for the EvalMatch API - AI-powered recruitment platform for intelligent resume analysis and bias-free hiring.\n\n## Features\n\n- 🔥 **Full TypeScript support** with auto-generated types\n- 🔐 **Firebase Authentication** integration\n- 📱 **Cross-platform** - works in Node.js, browsers, and React Native\n- 🛡️ **Built-in error handling** with typed error classes\n- ⚡ **Automatic retries** and request optimization\n- 📦 **Tree-shakeable** - import only what you need\n\n## Installation\n\n```bash\nnpm install @evalmatch/sdk\n```\n\n## Quick Start\n\n### With Firebase Authentication\n\n```typescript\nimport { EvalMatchClient, FirebaseAuthProvider } from '@evalmatch/sdk';\nimport { getAuth } from 'firebase/auth';\n\n// Initialize Firebase Auth Provider\nconst authProvider = new FirebaseAuthProvider(getAuth());\n\n// Create EvalMatch client\nconst client = new EvalMatchClient({\n  authProvider,\n  baseUrl: 'https://evalmatch.app/api' // optional, defaults to production\n});\n\n// Upload and analyze a resume\nasync function analyzeResume() {\n  try {\n    // Upload resume\n    const resumeFile = new File([...], 'resume.pdf', { type: 'application/pdf' });\n    const resume = await client.resumes.upload(resumeFile);\n    \n    // Create job description\n    const job = await client.jobs.create({\n      title: 'Senior Full Stack Developer',\n      description: 'We are looking for an experienced developer...',\n      requirements: ['React', 'Node.js', 'TypeScript']\n    });\n    \n    // Analyze resume against job\n    const analysis = await client.analysis.analyze(job.data.id, [resume.data.id]);\n    \n    console.log('Match score:', analysis.data.overallScore);\n    console.log('Matched skills:', analysis.data.skillsMatch.matched);\n    \n  } catch (error) {\n    if (error instanceof ValidationError) {\n      console.error('Validation failed:', error.details);\n    } else if (error instanceof RateLimitError) {\n      console.error('Rate limited, retry after:', error.retryAfter);\n    } else {\n      console.error('Error:', error.message);\n    }\n  }\n}\n```\n\n### API Token Authentication (Server-to-Server)\n\nFor backend services and automation, use EvalMatch API tokens:\n\n```typescript\nimport { EvalMatchClient } from '@evalmatch/sdk';\n\n// Simple auth provider using API token\nclass ApiTokenAuthProvider {\n  constructor(private apiToken: string) {}\n  \n  async getToken() {\n    return this.apiToken; // Returns API token (em_<id>_<secret>)\n  }\n  \n  async isAuthenticated() {\n    return !!this.apiToken;\n  }\n}\n\nconst client = new EvalMatchClient({\n  authProvider: new ApiTokenAuthProvider(process.env.EVALMATCH_API_TOKEN!)\n});\n\n// Now you can use all SDK features without Firebase\nawait client.jobs.list();\nawait client.tokens.statusByToken(); // Check token usage\n```\n\n### Complete Dual-Auth Example\n\n```typescript\nimport { EvalMatchClient, FirebaseAuthProvider } from '@evalmatch/sdk';\nimport { getAuth } from 'firebase/auth';\n\n// End-to-end recruitment workflow example\nasync function completeRecruitmentWorkflow() {\n  // 1. Setup client (use Firebase for web apps, API tokens for servers)\n  const isServer = typeof window === 'undefined';\n  const client = new EvalMatchClient({\n    authProvider: isServer \n      ? new ApiTokenAuthProvider(process.env.EVALMATCH_API_TOKEN!)\n      : new FirebaseAuthProvider(getAuth())\n  });\n\n  // 2. Upload multiple resumes in batch\n  const resumeFiles = [resume1, resume2, resume3]; // File objects\n  const batchResult = await client.resumes.uploadBatch(resumeFiles);\n  console.log(`Uploaded ${batchResult.summary.successful} resumes`);\n\n  // 3. Create and manage job descriptions\n  const job = await client.jobs.create({\n    title: 'Senior Frontend Developer',\n    description: 'React expert with TypeScript experience...',\n    requirements: ['React', 'TypeScript', '5+ years experience']\n  });\n\n  // 4. Analyze bias in job description\n  const biasAnalysis = await client.analysis.analyzeBias(job.id);\n  if (biasAnalysis.data.riskLevel === 'high') {\n    console.warn('Job description may contain bias:', biasAnalysis.data.issues);\n  }\n\n  // 5. Run text-based analysis for quick screening\n  const quickAnalysis = await client.analysis.analyzeText({\n    resumeText: 'John Doe, Senior React Developer with 6 years...',\n    jobDescriptionText: job.description\n  });\n  console.log(`Quick match: ${quickAnalysis.matchPercentage}%`);\n\n  // 6. Full analysis with ranking\n  const resumeIds = batchResult.uploaded.map(r => r.id);\n  const fullAnalysis = await client.analysis.analyze(job.id, resumeIds);\n  \n  // Rank candidates by match percentage\n  const rankedCandidates = fullAnalysis.data.results\n    .sort((a, b) => b.matchPercentage - a.matchPercentage);\n  \n  console.log('Top candidates:', rankedCandidates.slice(0, 3));\n\n  // 7. Manage job descriptions\n  const allJobs = await client.jobs.list();\n  const updatedJob = await client.jobs.update(job.id, {\n    requirements: [...job.requirements, 'GraphQL'] // Add new requirement\n  });\n  \n  // 8. Check API usage (for API token users)\n  if (isServer) {\n    const tokenStatus = await client.tokens.statusByToken();\n    console.log(`API calls today: ${tokenStatus.usage.requestsToday}`);\n  }\n}\n```\n\n### Node.js Specific Examples\n\nFor Node.js applications, you can upload files using Buffers or Streams:\n\n```typescript\nimport fs from 'fs';\nimport { EvalMatchClient } from '@evalmatch/sdk';\n\nconst client = new EvalMatchClient({\n  authProvider: new ApiTokenAuthProvider(process.env.EVALMATCH_API_TOKEN!)\n});\n\n// Upload from Buffer\nconst pdfBuffer = fs.readFileSync('./resume.pdf');\nconst resume = await client.resumes.upload(pdfBuffer);\n\n// Upload multiple files as streams\nconst streams = ['resume1.pdf', 'resume2.pdf'].map(file => \n  fs.createReadStream(file)\n);\nconst batchResult = await client.resumes.uploadBatch(streams);\nconsole.log(`Batch upload: ${batchResult.summary.successful} successful`);\n```\n\n## API Reference\n\n### Client Methods\n\n#### Resumes\n\n```typescript\n// List user's resumes\nconst resumes = await client.resumes.list();\n\n// Upload a single resume file\nconst resume = await client.resumes.upload(file);\n\n// Upload multiple resumes in batch\nconst batchResult = await client.resumes.uploadBatch([file1, file2, file3]);\n\n// Get specific resume\nconst resume = await client.resumes.get(resumeId);\n```\n\n#### Job Descriptions (Full CRUD)\n\n```typescript\n// Create job description\nconst job = await client.jobs.create({\n  title: 'Software Engineer',\n  description: 'Join our team...',\n  requirements: ['JavaScript', 'React']\n});\n\n// List all job descriptions\nconst jobs = await client.jobs.list();\n\n// Get specific job description\nconst job = await client.jobs.get(jobId);\n\n// Update job description\nconst updatedJob = await client.jobs.update(jobId, {\n  title: 'Senior Software Engineer',\n  requirements: ['JavaScript', 'React', 'TypeScript']\n});\n\n// Delete job description\nconst result = await client.jobs.delete(jobId);\n```\n\n#### AI Analysis\n\n```typescript\n// Analyze resumes against job\nconst analysis = await client.analysis.analyze(jobId, [resumeId1, resumeId2]);\n\n// Check job description for bias\nconst biasAnalysis = await client.analysis.analyzeBias(jobId);\n\n// Quick text-based analysis (no file upload required)\nconst textAnalysis = await client.analysis.analyzeText({\n  resumeText: 'John Doe, Software Engineer...',\n  jobDescriptionText: 'We are looking for a developer...'\n});\n\nconsole.log('Match percentage:', textAnalysis.matchPercentage);\nconsole.log('Matched skills:', textAnalysis.matchedSkills);\nconsole.log('Missing skills:', textAnalysis.missingSkills);\n```\n\n#### Token Management (API Token Users)\n\n```typescript\n// Get current token status and usage\nconst tokenStatus = await client.tokens.statusByToken();\n\nconsole.log('Token status:', tokenStatus.token.status);\nconsole.log('Requests today:', tokenStatus.usage.requestsToday);\nconsole.log('Requests this month:', tokenStatus.usage.requestsThisMonth);\n```\n\n#### Credits and User Management\n\n```typescript\n// Check credit balance\nconst balance = await client.credits.balance();\n\n// View credit history\nconst history = await client.credits.history();\n\n// Get user profile\nconst profile = await client.user.profile();\n```\n\n### Error Handling\n\nThe SDK provides typed error classes for better error handling:\n\n```typescript\nimport { \n  ValidationError, \n  AuthenticationError, \n  RateLimitError, \n  ServerError \n} from '@evalmatch/sdk';\n\ntry {\n  await client.resumes.upload(file);\n} catch (error) {\n  if (error instanceof ValidationError) {\n    // Handle validation errors (400)\n    console.log('Validation details:', error.details);\n  } else if (error instanceof AuthenticationError) {\n    // Handle auth errors (401)\n    console.log('Please log in');\n  } else if (error instanceof RateLimitError) {\n    // Handle rate limiting (429)\n    console.log('Retry after:', error.retryAfter, 'seconds');\n  }\n}\n```\n\n### Configuration Options\n\n```typescript\nconst client = new EvalMatchClient({\n  authProvider: myAuthProvider,\n  baseUrl: 'https://custom.api.url',  // Custom API URL\n  timeout: 10000,                      // Request timeout (ms)\n  headers: {                           // Custom headers\n    'X-Custom-Header': 'value'\n  },\n  debug: true                          // Enable debug logging\n});\n```\n\n## TypeScript Types\n\nAll API types are automatically generated and exported:\n\n```typescript\nimport type { \n  Resume, \n  JobDescription, \n  AnalysisResult,\n  BiasAnalysis \n} from '@evalmatch/sdk';\n\nconst resume: Resume = {\n  id: 123,\n  filename: 'resume.pdf',\n  status: 'analyzed',\n  // ... fully typed\n};\n```\n\n## Browser Support\n\n- Chrome 63+\n- Firefox 67+\n- Safari 13.1+\n- Edge 79+\n\n## Node.js Support\n\n- Node.js 18+\n\n## Contributing\n\nThis SDK is auto-generated from the EvalMatch OpenAPI specification. For issues or feature requests, please visit our [main repository](https://github.com/puneetrinity/Evalmatch).\n\n## License\n\nCommercial License - see [LICENSE](https://evalmatch.app/license) for details.\n\n## Support\n\n- 📧 Email: hello@airevolabs.co.in\n- 📖 Documentation: https://evalmatch.app/docs/api\n- 🐛 Issues: https://github.com/puneetrinity/Evalmatch/issues","readmeFilename":"README.md","_rev":"1-d4a67879e6439b5d45ea4ec9fc159553"}