Skip to main content
Version: 4.6.19


Initialize Gentrace with the init() function. This allows other Gentrace SDK functions to transparently authenticate to Gentrace.


Directly passing arguments:

import { init } from '@gentrace/core';
apiKey: process.env.GENTRACE_API_KEY,
resultName: "My Test Result",
branch: "main",
commit: "1234567890"

Using environmental variables:

import { init } from '@gentrace/core';
// Environmental variables (e.g. GENTRACE_API_KEY) are expected to available in
// the process environment via a .env file, CI/CD environment primitives, etc.


apiKey: string

Create an API key here.

resultName?: string

Learn more about test result names here.

branch?: string

Associate a Git branch with the test result.

commit?: string

Associate a Git commit with the test result.

showConnectionErrors?: string

Connection errors (such as status code 502) are shown every 10 seconds. Set to "all" or "none" to change this default.

Environmental variables

You can also set environmental variables rather than directly passing the arguments to the init() function.


Replaces the apiKey argument.


Replaces the resultName argument.


Replaces the branch argument.


Replaces the commit argument.


Replaces the showConnectionErrors argument.