Official Node.js and browser SDK for Summize.app
Get started with the JavaScript SDK
npm install @summize/sdk
For Node.js applications and server-side usage.
<script src="https://unpkg.com/@summize/sdk@latest/dist/browser.js"></script>
For browser-based applications and frontend usage.
Get up and running in minutes
// Import the SDK
import { Summize } from '@summize/sdk';
// Initialize with your API key
const summize = new Summize('your-api-key');
// Generate a summary
const result = await summize.summarize({
data: salesData,
format: 'narrative',
style: 'executive'
});
console.log(result.summary);
Complete documentation of all methods and options
new Summize(apiKey, options?)
apiKey
(string) - Your Summize API keyoptions
(object, optional) - Configuration optionsbaseURL
- Custom API base URLtimeout
- Request timeout in millisecondsretries
- Number of retry attemptsGenerate AI-powered summaries from your data
const result = await summize.summarize(data, {
format: 'narrative',
style: 'executive',
maxLength: 500
});
data
- Your data to summarizeoptions.format
- 'narrative' | 'bullet' | 'executive'options.style
- 'technical' | 'business' | 'casual'options.maxLength
- Maximum summary lengthsummary
- Generated summary textinsights
- Array of key insightsconfidence
- Confidence score (0-1)processingTime
- Processing time in secondsRetrieve generated reports and summaries
const reports = await summize.getReports({
limit: 10,
offset: 0,
status: 'completed'
});
options.limit
- Number of reports to returnoptions.offset
- Pagination offsetoptions.status
- Filter by statusreports
- Array of report objectstotal
- Total number of reportshasMore
- Whether more reports existCommon use cases and patterns
const salesData = {
revenue: 125000,
growth: 15.5,
topProducts: ['Product A', 'Product B'],
regions: ['North', 'South', 'East']
};
const summary = await summize.summarize(salesData, {
format: 'executive',
style: 'business'
});
console.log(summary.summary);
// "Q4 revenue reached $125K with 15.5% growth..."
try {
const result = await summize.summarize(data);
console.log(result.summary);
} catch (error) {
if (error.code === 'RATE_LIMIT') {
console.log('Rate limit exceeded');
} else if (error.code === 'INVALID_API_KEY') {
console.log('Invalid API key');
} else {
console.log('Unexpected error:', error.message);
}
}
Upgrading from previous versions
Install the JavaScript SDK and start building with Summize.