Internal SDK for TAC Backend Services

Published: (February 25, 2026 at 09:44 AM EST)
3 min read
Source: Dev.to

Source: Dev.to

Overview

This package provides a standardized, shared Software Development Kit (SDK) for backend services within the TAC. It centralizes API clients, business‑logic services, and common utilities to promote code reuse and consistency.

Installation

Install the package from the internal package registry:

npm install @pwc-me-operate-internal/tac-internal-sdk

Creating an SDK Instance

The main export is a factory class named SDK. Instantiate it with a high‑level configuration object, and it will produce fully configured, performance‑optimized API clients and high‑level services.

const SDK = require('@pwc-me-operate-internal/tac-internal-sdk');

const sdkConfig = {
  // Process Backend API
  process: {
    baseURL: process.env.PROCESS_API_BASE_URL,
    apiKey: process.env.PROCESS_API_KEY,
  },
  // Candidate Backend API
  candidate: {
    baseURL: process.env.CANDIDATE_API_BASE_URL,
    apiKey: process.env.CANDIDATE_API_KEY,
  },
  // Org Unit (Admin) API
  orgUnit: {
    baseURL: process.env.ORG_UNIT_API_BASE_URL,
    apiKey: process.env.ORG_UNIT_API_KEY,
  },
  // Legacy SUN API
  sun: {
    baseURL: process.env.SUN_API_BASE_URL,
    subscription_key: process.env.SUN_API_SUBSCRIPTION_KEY,
  },
  // Optional data encryption/decryption
  encryption: {
    secret: process.env.ENCRYPTION_SECRET,
    iv: process.env.ENCRYPTION_IV,
  },
};

const sdk = new SDK(sdkConfig);

Services

Services provide high‑level business logic and orchestrate calls between different clients. They are the preferred way to interact with the SDK.

  • sdk.process – Interacts with the Process and Candidate APIs.
  • sdk.orgData – Interacts with the Org Unit API for employee, tower, and grade data.

Example: Using Services in an Express Controller

// In an Express controller or service file
class MyController {
  constructor(sdk) {
    this.sdk = sdk;
  }

  async getDemands(req, res) {
    // Use the ProcessService to fetch demands
    const demands = await this.sdk.process.getDemands({ page: 1, limit: 10 });
    res.json(demands);
  }

  async getEmployee(req, res) {
    // Use the OrgDataService to fetch an employee
    const employee = await this.sdk.orgData.getEmployeeById(req.params.id);
    res.json(employee);
  }
}

Direct API Clients

For low‑level calls, you can access the configured Axios‑based clients:

  • sdk.clients.process
  • sdk.clients.candidate
  • sdk.clients.orgUnit
  • sdk.clients.sun

Example: Health Check via the Process Client

// Get a health check directly from the Process API client
const health = await sdk.clients.process.healthCheck();

Utilities

The SDK includes several utility modules attached as static properties to the main export.

const { crypto } = SDK.utils;

// Example: Encrypt data using the SDK's encryption configuration
const encrypted = crypto.encrypt('secret-data', sdk.encryptionConfig);

Performance Considerations

The SDK is designed with best practices for performance and maintainability:

  • A single shared http.Agent and https.Agent is instantiated with keepAlive: true.
  • This reduces the overhead of TCP handshakes and improves request latency for server‑to‑server communication.

Future Additions (TODO)

  • SDK.constants
  • SDK.express
  • SDK.storage (e.g., GCP bucket integration)
0 views
Back to Blog

Related posts

Read more »

Elevate Your Code Quality with Husky

Introduction In modern software development, maintaining code quality isn’t just a nice‑to‑have—it’s essential. As teams grow and codebases expand, ensuring co...