Skip to main content

Installation & Configuration

Installation​

npm install @tingee/sdk-node
# or
yarn add @tingee/sdk-node
# or
pnpm add @tingee/sdk-node

Requirements: Node.js ≥ 18


Client configuration​

import { TingeeClient } from '@tingee/sdk-node';

const client = new TingeeClient({
secretKey: process.env.TINGEE_SECRET_KEY!,
clientId: process.env.TINGEE_CLIENT_ID!,
environment: 'production', // 'uat' | 'production'
timeout: 90000, // ms, default 90000
// baseUrl: 'https://custom-url.example.com', // overrides environment
});
OptionTypeDefaultDescription
secretKeystring—Required. Secret key from the Tingee Dashboard
clientIdstring—Required. Client ID from the Tingee Dashboard
environment'uat' | 'production''production'API environment
baseUrlstring—Overrides the URL (ignores environment)
timeoutnumber90000Timeout (ms)
Important security note

Use secretKey on the server side only. Never embed it in a frontend, mobile app or any other client-side environment.


Framework integration​

// tingee.module.ts
import { Module, Global } from '@nestjs/common';
import { TingeeClient } from '@tingee/sdk-node';

@Global()
@Module({
providers: [
{
provide: TingeeClient,
useFactory: () => new TingeeClient({
secretKey: process.env.TINGEE_SECRET_KEY!,
clientId: process.env.TINGEE_CLIENT_ID!,
}),
},
],
exports: [TingeeClient],
})
export class TingeeModule {}