2 min read
Create and await
import { PublicClient } from '@credicorp/sdk';
const credicorp = new PublicClient();
const quote = await credicorp.quote.oneTime({ amount: 300, term: 30, frequency: 'weekly' });
console.log(quote.totalRepayable);The public client needs no token — quotes are on the public ring.
Catch the range error
try {
const quote = await credicorp.quote.oneTime({ amount, term });
} catch (e) {
if (e instanceof RangeError) { /* clamp to 50-500 / 14-84 */ }
}
Front-end or server
You can run the public client in a Node server or, for a browser widget, call the endpoint directly with fetch — see the quote-widget recipe. For partner flows, the SDK handles token caching for you.
Frequently asked questions
Can I use the Node SDK in the browser?
For public reads, yes, though a direct fetch is often lighter. Never put partner credentials in the browser — partner-ring SDK use belongs on the server where the client secret is safe.
Is the quote call promise-based?
Yes. The Node SDK is async throughout — await the quote call and catch a typed RangeError for out-of-range inputs.
Related reading

Quote a Business Loan with the PHP SDK
The PHP SDK wraps the public quote endpoint so you fetch a live figure in three lines. It handles the HTTP,…
Read →
Quote a Business Loan with the Python SDK
The Python SDK wraps the public quote endpoint. Construct the client, call quote.one_time(...) with an amount…
Read →
Render a live Business Loan quote widget
Wire a small front-end control to the public quote endpoint so visitors get a live, accurate Business Loan…
Read →Funding for UK limited companies
Credicorp lends to your company, not to you personally — short-term working capital with no personal guarantee. See what your business could access.