Skip to main content
Import CorsaClient and configure it with your API details:
import { CorsaClient } from '@corsa-labs/sdk';

const client = new CorsaClient({
    BASE: "https://api.corsa.finance",
    HEADERS: {
        "Authorization": `Bearer ${process.env.API_TOKEN}`
    }
});
Alternatively, configure the global OpenAPI object:
import { CorsaClient, OpenAPI } from '@corsa-labs/sdk';

OpenAPI.BASE = 'https://api.corsa.finance';
OpenAPI.HEADERS = {
  "Authorization": `Bearer ${process.env.API_TOKEN}`
};

const client = new CorsaClient();

Configuration Options

OptionTypeDefaultDescription
BASEstring''Base URL for the API.
VERSIONstring'1.0'API version.
HEADERSRecord<string, string>undefinedCustom request headers. Recommended for authentication.
TOKENstringundefinedBearer token (deprecated; prefer HEADERS).
USERNAMEstringundefinedBasic auth username.
PASSWORDstringundefinedBasic auth password.
WITH_CREDENTIALSbooleanfalseInclude credentials in requests.
CREDENTIALS'include' | 'omit' | 'same-origin''include'Credentials mode for fetch.
ENCODE_PATH(path: string) => stringundefinedCustom path encoder.
ComplianceClient is a deprecated alias for CorsaClient. Use CorsaClient in new code.

Encrypted Client

For BYOK customers with field-level encryption:
import { EncryptedCorsaClient } from '@corsa-labs/sdk';

const client = EncryptedCorsaClient.withEncryptedFields(
  {
    baseUrl: "https://api.corsa.finance",
    apiKey: process.env.API_TOKEN,
    encryptionServiceUrl: "https://your-encryption-service.example.com",
  },
  encryptedFieldSchema
);