Client Configuration

Detailed guide on configuring the Links SDK client.

The LinksSDK constructor accepts a configuration object to handle authentication, networking, and environment settings.

Authentication

You must provide credentials to authenticate your requests. The SDK supports API Keys or Bearer Token

Use an API Key or Bearer Token for server-side integrations where the client acts on behalf of your organization.

import { LinksSDK } from "@links/sdk";

const client = new LinksSDK({
  apiKey: "<YOUR_API_KEY_OR_BEARER_TOKEN>", 
});

Network Configuration

Timeouts

To prevent long-hanging requests, you can configure a timeout (in milliseconds) via baseOptions.

const client = new LinksSDK({
  apiKey: "YOUR_API_KEY",
  baseOptions: {
    timeout: 5000, // 5 seconds
  },
});

Configuration Interface

The configuration object adheres to the following interface:

ParameterTypeDescription
apiKeystring | Promise<string>API key or a promise resolving to an API key.
baseOptionsobjectAxios request config options (timeout, etc.).

On this page