All notable changes to this project will be documented in this file.
The format is loosely based on Keep a Changelog, and this project adheres to Semantic Versioning. We follow the format used by Open Telemetry.
- Simplifies tsup bundling (#57)
- Adds custom error type to remove
any
(#58) - Improves the events types usage by exporting interfaces from
events.d.ts
(#72) - Reverts changes from (#37) (#72)
- Add validation to the response handler to prevent parsing of a No Content body (#44)
- Introduce a new way to initialize a client (#43)
As part of the new implementation, a Topsort Client that embeds all functions is now initialized by receiving a config. Also, some types have been simplified:
- TopsortAuction > Auction
- TopsortEvents > Event
Migration steps:
import { TopsortAuction, Config, reportAuction } from "@topsort/sdk";
const auction: TopsortAuction = {
//...
};
const config: Config = {
apiKey: "API_KEY",
};
createAuction(config, auction)
.then((result) => console.log(result))
.catch((error) => console.error(error));
import { Auction, Config, TopsortClient } from "@topsort/sdk";
const auction: Auction = {
//...
};
const config: Config = {
apiKey: "API_KEY",
};
const topsortClient = new TopsortClient(config);
topsortClient.createAuction(auction)
.then((result) => console.log(result))
.catch((error) => console.error(error));
import { TopsortEvent, Config, reportEvent } from "@topsort/sdk";
const event: TopsortEvent = {
//...
};
const config: Config = {
apiKey: "API_KEY",
};
reportEvent(config, event)
.then((result) => console.log(result))
.catch((error) => console.error(error));
import { Event, Config, TopsortClient } from "@topsort/sdk";
const event: Event = {
//...
};
const config: Config = {
apiKey: "API_KEY",
};
const topsortClient = new TopsortClient(config);
topsortClient.reportEvent(event)
.then((result) => console.log(result))
.catch((error) => console.error(error));
- Add support for Typescript with lower versions (#37)
- Add support for optional timeout on Config (#11)
- Add
userAgent: string
as part of Config for requests (#21) - Add
retry: boolean
as part ofreportEvent
response (#20)
- Initial release of the SDK (#1)
- Pull
reportEvent
from Analytics.js - Add function
createAuction