Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/analytics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = async function () {
mkdirSync(countlyDataDir, { recursive: true })
}

// @ts-expect-error
Countly.init({
url: 'https://countly.ipfs.io',
app_key: COUNTLY_KEY,
Expand All @@ -27,7 +26,6 @@ module.exports = async function () {
storage_path: countlyDataDir
})

// @ts-expect-error
getCtx().setProp('countlyDeviceId', Countly.device_id)

ipcMain.on(ipcMainEvents.COUNTLY_ADD_CONSENT, (_, consent) => {
Expand Down
32 changes: 32 additions & 0 deletions types/countly-sdk-nodejs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,39 @@ declare module 'countly-sdk-nodejs' {

export type ConsentFeatures = ConsentFeaturesIndividual | ConsentFeaturesGrouped

// Define an interface for the init options
export interface CountlyInitOptions {
app_key: string
url: string
storage_path: string
require_consent: boolean
app_version?: string
country_code?: string
city?: string
ip_address?: string
debug?: boolean
interval?: number
fail_timeout?: number
session_update?: number
max_events?: number
force_post?: boolean
remote_config?: boolean
http_options?: (args: unknown) => unknown
max_logs?: number
metrics?: unknown
device_id?: string
max_key_length?: number
max_value_size?: number
max_segmentation_values?: number
max_breadcrumb_count?: number
max_stack_trace_lines_per_thread?: number
max_stack_trace_line_length?: number
}

export interface CountlyType {
device_id: string
// Overload init to accept either options object or parameters
init: (options: CountlyInitOptions) => void
init: (
// app_key - mandatory, app key for your app created in Countly
app_key: string,
Expand Down