Guides

Migrating from v1

Move from the global client to createClient.

Before you start

Takes about ten minutes

Most apps change one file: the place that called tempo.configure().

Replace configure

ts
// v1import tempo from "tempo-http";tempo.configure({ baseUrl: API_URL });// v2import { createClient } from "tempo-http";export const api = createClient({ baseUrl: API_URL });

Renamed options

  • retries is now retry.attempts.
  • cacheTime is now cache.ttl, in milliseconds.
  • onFail is now onError.

ES modules only

require("tempo-http") no longer works. Node.js 20 can import it from CommonJS with a dynamic import().

Was this page helpful?

Updated