createEnterestOS()

Creates an EnterestOS client bound to a project.

2 minPrerequisites: SDK installed

Problem: You need a client instance before you can call trackResponse() — the SDK does not work without one.

Solution: Call createEnterestOS() with your project key and you have a working client ready for all tracking calls.

Signature

typescript
createEnterestOS(config: {
  projectKey: string;       // Required
  timeoutMs?: number;       // Optional: request timeout ms (default: 10000)
  retries?: number;         // Optional: retry count (default: 2)
  baseUrl?: string;         // Optional: API base URL
  headers?: Record<string, string>;  // Optional: extra headers
}): EnterestOSClient

Example

typescript
import { createEnterestOS } from '@enterestos/sdk';

const enterestos = createEnterestOS({
  projectKey: process.env.NEXT_PUBLIC_ENTERESTOS_PROJECT_KEY!
});

Returns

EnterestOSClient — an object with trackResponse() and testConnection() methods.

Result: You now have a client. Every trackResponse() call on this client will route to the project that matches your key.

Common Questions

How do I create an EnterestOS client?

Call createEnterestOS() with your project key. Store the result at module level and reuse it for all trackResponse() calls in that file.