JS SDK reference
Applies to: @crittora/sdk-js v2
Primary runtime: Node.js 18+
Last updated: March 8, 2026
This page explains the public JavaScript SDK surface at a high level so developers can choose between CrittoraClient, the built-in cognitoAuthProvider, and the legacy Crittora compatibility layer.
SDK surface
| API | Purpose | Use when |
|---|---|---|
| CrittoraClient | Primary SDK client for new integrations | You want explicit credentials, auth, timeouts, retries, and typed request objects |
| cognitoAuthProvider | Built-in Cognito login provider | You want the SDK to perform login and manage tokens |
| Crittora | Legacy compatibility shim | You need to preserve an older integration contract |
Recommended defaults
- Start new integrations with CrittoraClient.
- Use cognitoAuthProvider when you want the SDK to own the Cognito login step.
- Keep the legacy Crittora class only for compatibility, not as the default teaching path.
Related flows
- JS SDK quickstart covers installation and first use.
- Authentication models explains bearer-token versus managed credential flows.
- Legacy SDK migration shows how to move older integrations onto CrittoraClient.
