diff --git a/.changesets/remove-apikey-config-option.md b/.changesets/remove-apikey-config-option.md new file mode 100644 index 00000000..b4017c65 --- /dev/null +++ b/.changesets/remove-apikey-config-option.md @@ -0,0 +1,6 @@ +--- +bump: "major" +type: "remove" +--- + +Remove the `apiKey` config option. This has been renamed to `pushApiKey`. diff --git a/src/__tests__/config.test.ts b/src/__tests__/config.test.ts index 8966c098..4d974a29 100644 --- a/src/__tests__/config.test.ts +++ b/src/__tests__/config.test.ts @@ -140,22 +140,6 @@ describe("Configuration", () => { }) }) - describe("apiKey option", () => { - it("sets the pushApiKey config option with the apiKey value", () => { - const warnMock = jest.spyOn(console, "warn").mockImplementation(() => {}) - const apiKey = "my key" - config = new Configuration({ apiKey }) - - expect(config.data.pushApiKey).toEqual(apiKey) - expect(config.data.apiKey).toBeUndefined() - expect(config.sources.initial.pushApiKey).toEqual(apiKey) - expect(config.sources.initial.apiKey).toBeUndefined() - expect(warnMock).toBeCalledWith( - "DEPRECATED: The `apiKey` config option was renamed to `pushApiKey`. Please rename the config option given to the Appsignal module." - ) - }) - }) - describe("logFilePath", () => { it("uses the default log file path", () => { jest.spyOn(fs, "accessSync").mockImplementation(() => {}) diff --git a/src/config.ts b/src/config.ts index 6dbad273..fabb3154 100644 --- a/src/config.ts +++ b/src/config.ts @@ -19,13 +19,6 @@ export class Configuration { sources: Record> constructor(options: Partial) { - if (options.apiKey) { - console.warn( - "DEPRECATED: The `apiKey` config option was renamed to `pushApiKey`. Please rename the config option given to the Appsignal module." - ) - options.pushApiKey = options.apiKey - delete options.apiKey - } this.sources = { default: this._defaultValues(), system: this._systemValues(), diff --git a/src/config/options.ts b/src/config/options.ts index cf0a5b48..526f067e 100644 --- a/src/config/options.ts +++ b/src/config/options.ts @@ -2,7 +2,6 @@ import type { DefaultInstrumentationName } from "../client" export type AppsignalOptions = { active: boolean - apiKey: string caFilePath: string disableDefaultInstrumentations: DefaultInstrumentationName[] | boolean dnsServers: string[]