Home / Function/ notify() — astro Function Reference

notify() — astro Function Reference

Architecture documentation for the notify() function in index.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  9a6fb927_ad64_9179_e53e_1585ab599a88["notify()"]
  aa586462_b436_2ea0_2f45_107a3d7bae01["AstroTelemetry"]
  9a6fb927_ad64_9179_e53e_1585ab599a88 -->|defined in| aa586462_b436_2ea0_2f45_107a3d7bae01
  d8cb9ebb_db08_8c98_2e7e_d6b067751fe1["isValidNotice()"]
  9a6fb927_ad64_9179_e53e_1585ab599a88 -->|calls| d8cb9ebb_db08_8c98_2e7e_d6b067751fe1
  style 9a6fb927_ad64_9179_e53e_1585ab599a88 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/telemetry/src/index.ts lines 110–125

	async notify(callback: () => boolean | Promise<boolean>) {
		if (this.isDisabled || this.isCI) {
			this.debug(`[notify] telemetry has been disabled`);
			return;
		}
		// The end-user has already been notified about our telemetry integration!
		// Don't bother them about it again.
		if (this.isValidNotice()) {
			this.debug(`[notify] last notified on ${this.notifyDate}`);
			return;
		}
		const enabled = await callback();
		this.config.set(KEY.TELEMETRY_NOTIFY_DATE, new Date().valueOf().toString());
		this.config.set(KEY.TELEMETRY_ENABLED, enabled);
		this.debug(`[notify] telemetry has been ${enabled ? 'enabled' : 'disabled'}`);
	}

Domain

Subdomains

Frequently Asked Questions

What does notify() do?
notify() is a function in the astro codebase, defined in packages/telemetry/src/index.ts.
Where is notify() defined?
notify() is defined in packages/telemetry/src/index.ts at line 110.
What does notify() call?
notify() calls 1 function(s): isValidNotice.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free