Installation
Add the SDK to your project using your preferred package manager. The SDK requires Node.js 16+ or any modern JavaScript runtime.
npm
npm install @profsdk/core
yarn
yarn add @profsdk/core
pnpm
pnpm add @profsdk/core
Quick Start
Initialize the SDK with your API key and start making requests in under 10 lines of code.
JavaScript / TypeScript
import { ProfsdkClient } from '@profsdk/core';
const client = new ProfsdkClient({
apiKey: 'pk_live_your_api_key',
environment: 'production'
});
async function main() {
await client.connect();
const data = await client.fetch('/v1/portfolios', {
limit: 10,
sort: 'created_at'
});
console.log(data);
}
main();
API Reference
Complete documentation for all available methods, parameters, and return types.
Core Methods
| Method | Parameters | Returns | Description |
|---|---|---|---|
| connect() | void | Promise<boolean> | Establishes WebSocket connection to the SDK gateway |
| fetch(endpoint, opts) | string, object | Promise<DataResponse> | Makes authenticated HTTP request to specified endpoint |
| subscribe(event, callback) | string, function | UnsubscribeFn | Registers event listener for real-time updates |
| disconnect() | void | Promise<void> | Gracefully closes all connections and cleans up resources |
Configuration Options
Customize the SDK behavior by passing an options object during initialization.
apiKey
string Required
Your secret API key from the developer dashboard
environment
'development' | 'production'
Determines which API endpoints and logs are used
timeout
number
Request timeout in milliseconds (default: 5000)
retries
number
Number of automatic retry attempts on failure (default: 3)
debug
boolean
Enables verbose console logging for troubleshooting
basePath
string
Custom API base URL for self-hosted deployments
Changelog
Track updates, improvements, and breaking changes across SDK versions.
v1.2.0
2024-11-15
- Added real-time WebSocket subscriptions for live portfolio updates
- Improved TypeScript definitions with strict mode compatibility
- Added automatic retry logic with exponential backoff
v1.1.0
2024-09-22
- Introduced `fetch()` method for simplified HTTP requests
- Reduced bundle size by 35% using tree-shaking
- Added comprehensive error codes and recovery suggestions
v1.0.0
2024-07-01
- Initial stable release with core client functionality
- Full REST API coverage with pagination support
- ESM and CommonJS compatibility
Support & Resources
Get help, report issues, or connect with the development team.
Report a Bug
Submit issues on GitHub with reproduction steps
Community Discord
Chat with developers and get real-time help
Documentation
Read in-depth guides and API references
Email Support
dev-support@profsdk.dev for enterprise inquiries