Browser analyzer
Run PromptScore directly in the browser
The browser analyzer on promptscore.dev uses the same deterministic scoring pipeline as the CLI, with built-in profiles that do not require filesystem access.
What the browser surface does
- Parses the prompt in the client.
- Runs the deterministic rule registry locally.
- Builds the same `ScoreReport` shape used by the CLI and the Node library.
- Uses built-in `_base`, `claude`, and `gpt` profiles instead of the YAML loader.
- Leaves the hosted `promptscore.dev` analyzer offline by default, with no injected LLM client.
Browser-safe API
For client-side usage, import from `@promptscore/core/browser`. The browser entry exposes `analyzeWithProfile`, `format`, and the built-in profile helpers.
import { analyzeWithProfile, formatText } from '@promptscore/core/browser';
const report = await analyzeWithProfile('You are a helpful assistant. Summarize this article.', {
profileName: 'gpt',
});
console.log(report.overall);
console.log(formatText(report));Custom browser integrations can also pass `includeLlm: true` and an injected `llmClient`, but the hosted site does not enable that path today.
Privacy model
The current browser analyzer is local-first. Deterministic analysis does not send prompts to an external API.
Important: if you build a custom browser UI with an injected `llmClient`, keep that path clearly separated from the offline deterministic workflow so users always know when data would leave the browser.
When to use browser vs CLI
| Surface | Best for |
|---|---|
| Browser analyzer | Quick checks, demos, onboarding, and embedding a local analyzer in a UI. |
| CLI | Automation, CI, scripts, and repeatable prompt linting in repositories. |
| Core library | Custom integrations, internal tools, and app-specific workflows. |