Quickstart (JS/TS SDK)
6 min
when you create a new account, the account creation flow will automatically guide you through the process of creating your first trace alternatively, you can use the quickstart steps described below 1\) get api key create abv account create abv account create new api credentials in the project settings 2\) ingest your first trace install packages npm install @abvdev/tracing @abvdev/otel add credentials add your abv credentials to your environment variables make sure that you have a env file in your project root and a package like dotenv to load the variables env abv api key = "sk abv " abv base url = "https //app abv dev" # us region //abv base url = "https //eu app abv dev" # eu region initialize opentelemetry install the opentelemetry node sdk package npm install @opentelemetry/sdk node create a instrumentation ts file that initializes the opentelemetry nodesdk and registers the abvspanprocessor instrumentation ts import { nodesdk } from "@opentelemetry/sdk node"; import { abvspanprocessor } from "@abvdev/otel"; const sdk = new nodesdk({ spanprocessors \[new abvspanprocessor()], }); sdk start(); modify instrumentation ts file to use dotenv package to load the variables additional parameters are provided to get trace visible in the ui immediately instrumentation ts import dotenv from "dotenv"; dotenv config(); import { nodesdk } from "@opentelemetry/sdk node"; import { abvspanprocessor } from "@abvdev/otel"; const sdk = new nodesdk({ spanprocessors \[ new abvspanprocessor({ apikey process env abv api key, baseurl process env abv base url, exportmode "immediate", flushat 1, flushinterval 1, additionalheaders { "content type" "application/json", "accept" "application/json" } }) ], }); sdk start(); import the instrumentation ts file at the top of your application index ts import " /instrumentation"; // must be the first import instrument application server ts import { startactiveobservation, startobservation } from "@abvdev/tracing"; await startactiveobservation("user request", async (span) => { span update({ input { query "what is the capital of france?" }, }); // this generation will automatically be a child of "user request" const generation = startobservation( "llm call", { model "gpt 5 2025 08 07", input \[{ role "user", content "what is the capital of france?" }], }, { astype "generation" }, ); // llm call logic generation update({ output { content "the capital of france is paris " }, }) end(); span update({ output "successfully answered " }); }); run your application execute your application you should see your trace appear in the abv ui npx tsx server ts