Official JavaScript & TypeScript SDK for the Nvisy document redaction platform.
- Modern ES2022+ JavaScript with native private fields
- Full TypeScript support with strict typing
- Flexible configuration with constructor or builder pattern
- Built-in environment variable support
- Automatic retry logic with smart error handling
- Individual module exports for optimal bundling
npm install @nvisy/sdk
Create a client by passing configuration options directly to the constructor:
import { Client } from "@nvisy/sdk";
const client = new Client({
apiKey: "your-api-key", // Required: 10+ chars, alphanumeric with _ and -
baseUrl: "https://api.nvisy.com", // Optional: API endpoint (default shown)
timeout: 30000, // Optional: 1000-300000ms (default: 30000)
maxRetries: 3, // Optional: 0-5 attempts (default: 3)
headers: { // Optional: custom headers
"X-Custom-Header": "value",
},
});
Use the fluent builder API for more readable configuration:
import { Client } from "@nvisy/sdk";
const client = Client.builder()
.withApiKey("your-api-key") // Required: 10+ chars, alphanumeric with _ and -
.withBaseUrl("https://api.nvisy.com") // Optional: API endpoint (default shown)
.withTimeout(60000) // Optional: 1000-300000ms (default: 30000)
.withMaxRetries(5) // Optional: 0-5 attempts (default: 3)
.withHeader("X-Custom-Header", "value") // Optional: single custom header
.withHeaders({ "X-Another": "header" }) // Optional: multiple custom headers
.build();
Load configuration from environment variables:
import { Client, ClientBuilder } from "@nvisy/sdk";
// Using builder pattern from environment (allows additional configuration)
const client = ClientBuilder.fromEnvironment()
.withTimeout(60000) // Override or add to env config
.build();
// Or using Client directly
const client = Client.fromEnvironment();
Set these environment variables:
Variable | Description | Required |
---|---|---|
NVISY_API_KEY |
API key for authentication | Yes |
NVISY_BASE_URL |
Custom API endpoint URL | No |
NVISY_TIMEOUT |
Request timeout in milliseconds | No |
NVISY_MAX_RETRIES |
Maximum number of retry attempts | No |
- Node.js 20.0.0 or higher
- TypeScript 5.9.0 or higher (for development)
See CHANGELOG.md for release notes and version history.
See CONTRIBUTING.md for development guidelines.
MIT License - see LICENSE.txt for details.
- Documentation: docs.nvisy.com
- Issues: GitHub Issues
- Email: support@nvisy.com