Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nayalsaurav/resume-analyzer/llms.txt
Use this file to discover all available pages before exploring further.
analyzeResume is a Next.js server action ("use server") that orchestrates the full resume analysis pipeline. It validates all inputs, constructs a detailed ATS-focused prompt via prepareInstructions, delegates the AI call to getAiResponse, and returns a structured Feedback object ready for display.
Signature
Parameters
Name of the target company the applicant is applying to. Used as context in the AI prompt so the model can tailor ATS keyword recommendations to the specific employer.
The exact position title being applied for (e.g.
"Senior Frontend Engineer"). Passed directly into the analysis prompt to align scoring with role-specific expectations.Full text of the job description copied from the posting. The AI compares resume content against this text for keyword matching, relevance scoring, and ATS compatibility.
The applicant’s resume as a browser
File object. Must be a PDF (application/pdf) and no larger than 10 MB. The file is base64-encoded before being sent to the Gemini model.Return Type
ReturnsPromise<Feedback> — the complete AI analysis result containing an overall score and five scored sections, each with 3–4 actionable tips.
Validation
Before the AI call is made,validateInputs checks every field and collects all failures into a single error. If any rule is violated, the action throws immediately and the AI is never contacted.
| Rule | Condition |
|---|---|
companyName is required | Must not be empty or whitespace-only |
jobTitle is required | Must not be empty or whitespace-only |
jobDescription is required | Must not be empty or whitespace-only |
file is required | Must be a non-null File object |
file.type must be PDF | file.type === "application/pdf" |
file.size must be ≤ 10 MB | file.size <= 10 × 1024 × 1024 bytes |
validateInputs throws:
Error Handling
Validation errors are re-thrown to the caller — your form or API route is responsible for catching them and surfacing the message to the user.
getAiResponse. That function catches all AI-layer exceptions and returns a zero-score fallback Feedback object so the UI always receives a valid data shape rather than an unhandled rejection.
Usage Example
The example below shows how to callanalyzeResume from a client component’s form submit handler using React state for loading and error feedback.