Client Configuration
Configure the SecBlastClient with your API key and optional settings.
Initialization
typescript
import { SecBlastClient } from '@secblast/sdk';
const client = new SecBlastClient({ apiKey: 'your-api-key' });Configuration Options
| Name | Type | Description |
|---|---|---|
apiKeyrequired | string | Your SEC Blast API key |
timeout | number | Request timeout in milliseconds (default: 30000) |
Async Client
The TypeScript SDK uses async/await for all API calls. All methods return Promises.
typescript
// All methods are async
const entities = await client.entityLookup({ tickers: ['AAPL'] });
const filings = await client.filingLookup({ tickers: ['AAPL'] });Error Handling
typescript
import {
SecBlastClient,
SecBlastError,
AuthenticationError,
RateLimitError,
ValidationError,
NotFoundError
} from '@secblast/sdk';
try {
const result = await client.entityLookup({ tickers: ['AAPL'] });
} catch (error) {
if (error instanceof AuthenticationError) {
console.error('Invalid API key');
} else if (error instanceof RateLimitError) {
console.error('Rate limit exceeded, retry after:', error.retryAfter);
} else if (error instanceof ValidationError) {
console.error('Invalid parameters:', error.message);
} else if (error instanceof NotFoundError) {
console.error('Resource not found');
} else if (error instanceof SecBlastError) {
console.error('API error:', error.message);
}
}