Skip to main content

Quick Start Guide for Suger TS SDK

Follow these steps to get started with the Suger TS SDK:

Step 1: Install the SDK

To include the Suger SDK in your project, you can use npm in your terminal:

npm install suger-sdk-ts@latest.version --save

Step 2: Create Config for Api

Once you have added the package, you can create a configuration. Here’s how to do it:

const server = new ServerConfiguration<{}>("https://api.suger.cloud", {})
const apiKey = "Key " + 'your-api-key'
const authConfig: api.AuthMethodsConfiguration = {
APIKeyAuth: apiKey,
}

// Create configuration parameter object
const configurationParameters = {
baseServer: server, // First server is default
authMethods: authConfig, // No auth is default
}
const configuration = new Configuration(configurationParameters)

Step 3: Create Api and Call APIs

Now you can create a client instance:

const offerApi = new OfferApi(configuration);
const orgId = 'your_org_id'
const offerId = "your_offer_id"
const offer = await offerApi.getOffer(orgId, offerId)

Conclusion

You are now ready to use the Suger TS SDK in your application! For more detailed information and advanced usage, please refer to the official documentation.