From c403196c1bba9ad94b9eef84d7b9b8e38c71afc6 Mon Sep 17 00:00:00 2001 From: Brian Love Date: Sat, 16 May 2026 10:13:41 -0700 Subject: [PATCH] fix: remove legacy licensing telemetry --- .../getting-started/introduction.mdx | 8 +- .../docs/licensing/guides/ci-and-offline.mdx | 25 +---- .../content/docs/licensing/guides/setup.mdx | 4 - .../content/docs/licensing/reference/api.mdx | 38 +------- libs/chat/src/lib/provide-chat.ts | 8 -- libs/langgraph/src/lib/agent.provider.ts | 11 --- libs/licensing/README.md | 11 +-- libs/licensing/src/index.ts | 6 -- .../src/lib/run-license-check.spec.ts | 45 +++------ libs/licensing/src/lib/run-license-check.ts | 18 ---- libs/licensing/src/lib/telemetry.spec.ts | 91 ------------------- libs/licensing/src/lib/telemetry.ts | 74 --------------- libs/render/src/lib/provide-render.ts | 8 -- 13 files changed, 22 insertions(+), 325 deletions(-) delete mode 100644 libs/licensing/src/lib/telemetry.spec.ts delete mode 100644 libs/licensing/src/lib/telemetry.ts diff --git a/apps/website/content/docs/licensing/getting-started/introduction.mdx b/apps/website/content/docs/licensing/getting-started/introduction.mdx index 95b572cfe..077b9efea 100644 --- a/apps/website/content/docs/licensing/getting-started/introduction.mdx +++ b/apps/website/content/docs/licensing/getting-started/introduction.mdx @@ -1,6 +1,6 @@ # Introduction -`@ngaf/licensing` is the shared license-check helper used by the framework packages. It verifies compact Ed25519-signed tokens offline, evaluates the result into a small status set, emits non-blocking warnings, and sends non-blocking license telemetry when asked. +`@ngaf/licensing` is the shared license-check helper used by the framework packages. It verifies compact Ed25519-signed tokens offline, evaluates the result into a small status set, and emits non-blocking warnings when appropriate. The package itself is MIT licensed. `COMMERCIAL.md` states that the libraries in this repository are free to use, modify, and distribute in commercial and noncommercial projects. The proprietary part called out there is the internal minting service, not this package. @@ -12,11 +12,10 @@ The main entry point exports: |-----|---------| | `verifyLicense()` | verifies token signature against a public key | | `evaluateLicense()` | turns a verify result and current time into a status | -| `runLicenseCheck()` | verifies, evaluates, warns once, and sends non-blocking telemetry | +| `runLicenseCheck()` | verifies, evaluates, and warns once | | `emitNag()` | emits the warning for non-licensed statuses | | `signLicense()` | signs claims with an Ed25519 private key | | `inferNoncommercial()` | returns a default noncommercial hint from `NODE_ENV` | -| `createTelemetryClient()` | sends a license telemetry POST | | `LICENSE_PUBLIC_KEY` | bundled public key | `@noble/ed25519` is the only peer dependency. @@ -66,7 +65,6 @@ The higher-level check is designed not to block app startup: - signature verification is local; - warning output goes through `console.warn` unless a custom `warn` function is supplied; -- telemetry is fire-and-forget; -- telemetry send failures are swallowed by the telemetry client. +- no network request is made by the licensing check. The code returns statuses instead of throwing for normal license states. Consumers can choose what to do with the status, but the framework packages use it as a warning and visibility mechanism, not as an app kill switch. diff --git a/apps/website/content/docs/licensing/guides/ci-and-offline.mdx b/apps/website/content/docs/licensing/guides/ci-and-offline.mdx index 92c544dea..28cba3af0 100644 --- a/apps/website/content/docs/licensing/guides/ci-and-offline.mdx +++ b/apps/website/content/docs/licensing/guides/ci-and-offline.mdx @@ -26,10 +26,8 @@ If you call `runLicenseCheck()` directly, inject the current time only when you ```ts await runLicenseCheck({ package: '@ngaf/example', - version: '1.0.0', token, publicKey, - telemetryEndpoint, nowSec: 1_735_689_600, }); ``` @@ -47,28 +45,7 @@ const result = evaluateLicense(verified, { }); ``` -This does not emit warnings and does not send telemetry. - -## Telemetry in licensing checks - -`runLicenseCheck()` creates a telemetry client and calls `send()` without awaiting it. The telemetry body contains: - -- package name; -- package version; -- license id from `claims.sub`, when present; -- an anonymous instance id; -- epoch-second timestamp. - -The licensing telemetry helper opts out when either of these is set: - -```bash -CACHEPLANE_TELEMETRY=0 -CACHEPLANE_TELEMETRY=false -``` - -It also checks `globalThis.CACHEPLANE_TELEMETRY` and treats `false`, `0`, or `"0"` as opt-out values. - -If `fetch` is not available, the telemetry send is a no-op. If the request fails, the error is swallowed. +This does not emit warnings. The higher-level `runLicenseCheck()` helper can emit warnings, but it does not make network requests. ## Signing tokens diff --git a/apps/website/content/docs/licensing/guides/setup.mdx b/apps/website/content/docs/licensing/guides/setup.mdx index 71394a288..2de2add48 100644 --- a/apps/website/content/docs/licensing/guides/setup.mdx +++ b/apps/website/content/docs/licensing/guides/setup.mdx @@ -26,10 +26,8 @@ import { const status = await runLicenseCheck({ package: '@ngaf/example', - version: '1.0.0', token: process.env.NGAF_LICENSE, publicKey: LICENSE_PUBLIC_KEY, - telemetryEndpoint: 'https://telemetry.example.com/v1/ping', isNoncommercial: inferNoncommercial(), }); ``` @@ -57,10 +55,8 @@ You can inject a custom warning sink: ```ts await runLicenseCheck({ package: '@ngaf/example', - version: '1.0.0', token, publicKey, - telemetryEndpoint, warn: (message) => logger.warn(message), }); ``` diff --git a/apps/website/content/docs/licensing/reference/api.mdx b/apps/website/content/docs/licensing/reference/api.mdx index 55393eadc..9932ff45b 100644 --- a/apps/website/content/docs/licensing/reference/api.mdx +++ b/apps/website/content/docs/licensing/reference/api.mdx @@ -80,14 +80,11 @@ Turns a verify result into a `LicenseStatus`. ```ts interface RunLicenseCheckOptions { package: string; - version: string; token?: string; publicKey: Uint8Array; - telemetryEndpoint: string; nowSec?: number; isNoncommercial?: boolean; warn?: (message: string) => void; - fetch?: typeof fetch; } function runLicenseCheck( @@ -99,8 +96,7 @@ Runs the full check: 1. verifies the token when present; 2. evaluates the license status; -3. emits a warning when appropriate; -4. sends non-blocking telemetry. +3. emits a warning when appropriate. Repeated calls with the same package and token are treated as already handled and return `licensed`. @@ -138,35 +134,3 @@ function signLicense( ``` Signs claims with an Ed25519 private key and returns the compact token consumed by `verifyLicense()`. - -## createTelemetryClient() - -```ts -interface TelemetryEvent { - package: string; - version: string; - licenseId?: string; -} - -interface CreateTelemetryClientOptions { - endpoint: string; - fetch?: typeof fetch; - generateInstanceId?: () => string; -} -``` - -`createTelemetryClient(options).send(event)` POSTs JSON to the configured endpoint unless telemetry is opted out or `fetch` is unavailable. - -The request body uses snake-case fields: - -```json -{ - "package": "@ngaf/example", - "version": "1.0.0", - "license_id": "cus_123", - "anon_instance_id": "generated-id", - "ts": 1735689600 -} -``` - -Send failures are swallowed. diff --git a/libs/chat/src/lib/provide-chat.ts b/libs/chat/src/lib/provide-chat.ts index 4f8336300..c047b3eec 100644 --- a/libs/chat/src/lib/provide-chat.ts +++ b/libs/chat/src/lib/provide-chat.ts @@ -8,12 +8,6 @@ import { import type { AngularRegistry } from '@ngaf/render'; const PACKAGE_NAME = '@ngaf/chat'; -declare const __CACHEPLANE_CHAT_VERSION__: string | undefined; -const PACKAGE_VERSION = - typeof __CACHEPLANE_CHAT_VERSION__ !== 'undefined' - ? __CACHEPLANE_CHAT_VERSION__ - : '0.0.0-dev'; -const TELEMETRY_ENDPOINT = 'https://telemetry.cacheplane.dev/v1/ping'; export interface ChatConfig { /** Default render registry for generative UI components. */ @@ -42,10 +36,8 @@ export const CHAT_CONFIG = new InjectionToken('CHAT_CONFIG'); export function provideChat(config: ChatConfig) { void runLicenseCheck({ package: PACKAGE_NAME, - version: PACKAGE_VERSION, token: config.license, publicKey: config.__licensePublicKey ?? LICENSE_PUBLIC_KEY, - telemetryEndpoint: TELEMETRY_ENDPOINT, isNoncommercial: config.__licenseEnvHint?.isNoncommercial ?? inferNoncommercial(), }); diff --git a/libs/langgraph/src/lib/agent.provider.ts b/libs/langgraph/src/lib/agent.provider.ts index d330dd536..b4735e555 100644 --- a/libs/langgraph/src/lib/agent.provider.ts +++ b/libs/langgraph/src/lib/agent.provider.ts @@ -8,15 +8,6 @@ import { import { AgentTransport } from './agent.types'; const PACKAGE_NAME = '@ngaf/langgraph'; -// Wired up by the release pipeline — imported lazily to avoid a hard build-time -// dependency on package.json. -declare const __CACHEPLANE_AGENT_VERSION__: string | undefined; -const PACKAGE_VERSION = - typeof __CACHEPLANE_AGENT_VERSION__ !== 'undefined' - ? __CACHEPLANE_AGENT_VERSION__ - : '0.0.0-dev'; -const TELEMETRY_ENDPOINT = - 'https://telemetry.cacheplane.dev/v1/ping'; /** * Global configuration for agent instances. @@ -52,10 +43,8 @@ export function provideAgent(config: AgentConfig): Provider { // Fire-and-forget license check. Never blocks DI resolution. void runLicenseCheck({ package: PACKAGE_NAME, - version: PACKAGE_VERSION, token: config.license, publicKey: config.__licensePublicKey ?? LICENSE_PUBLIC_KEY, - telemetryEndpoint: TELEMETRY_ENDPOINT, isNoncommercial: config.__licenseEnvHint?.isNoncommercial ?? inferNoncommercial(), }); diff --git a/libs/licensing/README.md b/libs/licensing/README.md index 544546c8a..303fd3dad 100644 --- a/libs/licensing/README.md +++ b/libs/licensing/README.md @@ -1,7 +1,7 @@ # @ngaf/licensing -Offline Ed25519 license verification + non-blocking telemetry for the Cacheplane -Angular framework libraries. +Offline Ed25519 license verification for the Cacheplane Angular framework +libraries. ## Status @@ -13,10 +13,7 @@ Private, pre-1.0. Consumed by `@ngaf/langgraph`, `@ngaf/render`, and - `verifyLicense(token, publicKey)` — pure Ed25519 verification, no I/O. - `evaluateLicense(result, { nowSec })` — returns one of `licensed | grace | expired | missing | tampered | noncommercial`. -- `runLicenseCheck(options)` — runs verification, emits a single - `console.warn` with the `[cacheplane]` prefix when unlicensed, and fires a - non-blocking telemetry POST. +- `runLicenseCheck(options)` — runs verification and emits a single + `console.warn` with the `[cacheplane]` prefix when unlicensed. - **Never throws from init** — every failure mode is reported via warn, never by throwing or blocking the host application's startup. -- **Opt out of telemetry** — set `CACHEPLANE_TELEMETRY=0` in the environment, or - `globalThis.CACHEPLANE_TELEMETRY = false`. diff --git a/libs/licensing/src/index.ts b/libs/licensing/src/index.ts index 5965d700e..0220cc065 100644 --- a/libs/licensing/src/index.ts +++ b/libs/licensing/src/index.ts @@ -6,12 +6,6 @@ export type { LicenseStatus, EvaluateResult, EvaluateOptions } from './lib/evalu export { evaluateLicense } from './lib/evaluate-license.js'; export type { EmitNagOptions } from './lib/nag.js'; export { emitNag } from './lib/nag.js'; -export type { - TelemetryEvent, - TelemetryClient, - CreateTelemetryClientOptions, -} from './lib/telemetry.js'; -export { createTelemetryClient } from './lib/telemetry.js'; export type { RunLicenseCheckOptions } from './lib/run-license-check.js'; export { runLicenseCheck } from './lib/run-license-check.js'; export { signLicense } from './lib/sign-license.js'; diff --git a/libs/licensing/src/lib/run-license-check.spec.ts b/libs/licensing/src/lib/run-license-check.spec.ts index 88959d28e..145446d5b 100644 --- a/libs/licensing/src/lib/run-license-check.spec.ts +++ b/libs/licensing/src/lib/run-license-check.spec.ts @@ -18,48 +18,40 @@ describe('runLicenseCheck', () => { let kp: DevKeyPair; let validToken: string; let warn: ReturnType; - let fetchMock: ReturnType; beforeEach(async () => { kp = await generateKeyPair(); validToken = await signLicense(BASE, kp.privateKey); warn = vi.fn(); - fetchMock = vi.fn().mockResolvedValue(new Response(null, { status: 204 })); __resetNagStateForTests(); __resetRunLicenseCheckStateForTests(); }); afterEach(() => { __resetNagStateForTests(); __resetRunLicenseCheckStateForTests(); + vi.restoreAllMocks(); }); - it('does not warn with a valid token and still fires telemetry', async () => { + it('does not warn with a valid token and does not perform network I/O', async () => { + const fetchSpy = vi.spyOn(globalThis, 'fetch'); const status = await runLicenseCheck({ package: '@ngaf/langgraph', - version: '1.0.0', token: validToken, publicKey: kp.publicKey, nowSec: 1_900_000_000, - telemetryEndpoint: 'https://t.example.com/v1', warn, - fetch: fetchMock, }); expect(status).toBe('licensed'); expect(warn).not.toHaveBeenCalled(); - expect(fetchMock).toHaveBeenCalledOnce(); - const body = JSON.parse(fetchMock.mock.calls[0][1].body as string); - expect(body.license_id).toBe('cus_abc'); + expect(fetchSpy).not.toHaveBeenCalled(); }); it('warns when token is missing', async () => { const status = await runLicenseCheck({ package: '@ngaf/langgraph', - version: '1.0.0', publicKey: kp.publicKey, nowSec: 1_900_000_000, - telemetryEndpoint: 'https://t.example.com/v1', warn, - fetch: fetchMock, }); expect(status).toBe('missing'); expect(warn).toHaveBeenCalledOnce(); @@ -68,51 +60,40 @@ describe('runLicenseCheck', () => { it('is idempotent per (package, token) pair', async () => { await runLicenseCheck({ package: '@ngaf/langgraph', - version: '1.0.0', token: validToken, publicKey: kp.publicKey, nowSec: 1_900_000_000, - telemetryEndpoint: 'https://t.example.com/v1', warn, - fetch: fetchMock, }); await runLicenseCheck({ package: '@ngaf/langgraph', - version: '1.0.0', token: validToken, publicKey: kp.publicKey, nowSec: 1_900_000_000, - telemetryEndpoint: 'https://t.example.com/v1', warn, - fetch: fetchMock, }); - // Second call is a no-op: no extra warn (already guarded by nag dedupe anyway), - // and crucially no second telemetry POST. - expect(fetchMock).toHaveBeenCalledOnce(); + // Second call is a no-op: no extra warn, already guarded by nag dedupe. + expect(warn).not.toHaveBeenCalled(); }); it('re-runs when token changes (e.g., after key rotation in the host)', async () => { - const otherToken = await signLicense({ ...BASE, sub: 'cus_xyz' }, kp.privateKey); - await runLicenseCheck({ + const tamperedToken = `${validToken.slice(0, -1)}x`; + const first = await runLicenseCheck({ package: '@ngaf/langgraph', - version: '1.0.0', token: validToken, publicKey: kp.publicKey, nowSec: 1_900_000_000, - telemetryEndpoint: 'https://t.example.com/v1', warn, - fetch: fetchMock, }); - await runLicenseCheck({ + const second = await runLicenseCheck({ package: '@ngaf/langgraph', - version: '1.0.0', - token: otherToken, + token: tamperedToken, publicKey: kp.publicKey, nowSec: 1_900_000_000, - telemetryEndpoint: 'https://t.example.com/v1', warn, - fetch: fetchMock, }); - expect(fetchMock).toHaveBeenCalledTimes(2); + expect(first).toBe('licensed'); + expect(second).toBe('tampered'); + expect(warn).toHaveBeenCalledOnce(); }); }); diff --git a/libs/licensing/src/lib/run-license-check.ts b/libs/licensing/src/lib/run-license-check.ts index 6423971bd..3ea5cdc2b 100644 --- a/libs/licensing/src/lib/run-license-check.ts +++ b/libs/licensing/src/lib/run-license-check.ts @@ -2,27 +2,20 @@ import { verifyLicense } from './verify-license.js'; import { evaluateLicense, type LicenseStatus } from './evaluate-license.js'; import { emitNag } from './nag.js'; -import { createTelemetryClient } from './telemetry.js'; export interface RunLicenseCheckOptions { /** Fully-qualified host package name. */ package: string; - /** Host package version (e.g., "1.0.0"). */ - version: string; /** User-supplied license token, or undefined. */ token?: string; /** Ed25519 public key to verify against. */ publicKey: Uint8Array; - /** Telemetry endpoint URL. */ - telemetryEndpoint: string; /** Current time in epoch seconds. Defaults to now. Injected for testability. */ nowSec?: number; /** Hint that the environment is noncommercial (e.g. NODE_ENV !== 'production'). */ isNoncommercial?: boolean; /** Injected warn channel, defaults to console.warn. */ warn?: (message: string) => void; - /** Injected fetch, defaults to globalThis.fetch. */ - fetch?: typeof fetch; } const done = new Set(); @@ -48,17 +41,6 @@ export async function runLicenseCheck( emitNag(evaluated, { package: options.package, warn: options.warn }); - const telemetry = createTelemetryClient({ - endpoint: options.telemetryEndpoint, - fetch: options.fetch, - }); - // Fire-and-forget; do not await the host's init on it. - void telemetry.send({ - package: options.package, - version: options.version, - licenseId: evaluated.claims?.sub, - }); - return evaluated.status; } diff --git a/libs/licensing/src/lib/telemetry.spec.ts b/libs/licensing/src/lib/telemetry.spec.ts deleted file mode 100644 index bfbb91617..000000000 --- a/libs/licensing/src/lib/telemetry.spec.ts +++ /dev/null @@ -1,91 +0,0 @@ -// SPDX-License-Identifier: MIT -import { afterEach, beforeEach, describe, it, expect, vi } from 'vitest'; -import { createTelemetryClient } from './telemetry'; - -describe('createTelemetryClient', () => { - const origEnv = { ...process.env }; - const origGlobal = (globalThis as Record).CACHEPLANE_TELEMETRY; - - beforeEach(() => { - process.env = { ...origEnv }; - delete process.env.CACHEPLANE_TELEMETRY; - delete (globalThis as Record).CACHEPLANE_TELEMETRY; - }); - - afterEach(() => { - process.env = origEnv; - (globalThis as Record).CACHEPLANE_TELEMETRY = origGlobal; - }); - - it('posts a payload to the endpoint with a generated anon_instance_id', async () => { - const fetchMock = vi.fn().mockResolvedValue(new Response(null, { status: 204 })); - const client = createTelemetryClient({ - endpoint: 'https://telemetry.example.com/v1/ping', - fetch: fetchMock, - }); - - await client.send({ - package: '@ngaf/langgraph', - version: '1.0.0', - licenseId: 'cus_123', - }); - - expect(fetchMock).toHaveBeenCalledOnce(); - const [url, init] = fetchMock.mock.calls[0]; - expect(url).toBe('https://telemetry.example.com/v1/ping'); - expect(init.method).toBe('POST'); - const body = JSON.parse(init.body as string); - expect(body.package).toBe('@ngaf/langgraph'); - expect(body.version).toBe('1.0.0'); - expect(body.license_id).toBe('cus_123'); - expect(typeof body.anon_instance_id).toBe('string'); - expect(body.anon_instance_id.length).toBeGreaterThan(0); - }); - - it('reuses the same anon_instance_id across calls from the same client', async () => { - const fetchMock = vi.fn().mockResolvedValue(new Response(null, { status: 204 })); - const client = createTelemetryClient({ - endpoint: 'https://telemetry.example.com/v1/ping', - fetch: fetchMock, - }); - await client.send({ package: '@ngaf/langgraph', version: '1.0.0' }); - await client.send({ package: '@ngaf/langgraph', version: '1.0.0' }); - - const id1 = JSON.parse(fetchMock.mock.calls[0][1].body as string).anon_instance_id; - const id2 = JSON.parse(fetchMock.mock.calls[1][1].body as string).anon_instance_id; - expect(id1).toBe(id2); - }); - - it('is a no-op when CACHEPLANE_TELEMETRY=0 env is set', async () => { - process.env.CACHEPLANE_TELEMETRY = '0'; - const fetchMock = vi.fn(); - const client = createTelemetryClient({ - endpoint: 'https://telemetry.example.com/v1/ping', - fetch: fetchMock, - }); - await client.send({ package: '@ngaf/langgraph', version: '1.0.0' }); - expect(fetchMock).not.toHaveBeenCalled(); - }); - - it('is a no-op when globalThis.CACHEPLANE_TELEMETRY === false', async () => { - (globalThis as Record).CACHEPLANE_TELEMETRY = false; - const fetchMock = vi.fn(); - const client = createTelemetryClient({ - endpoint: 'https://telemetry.example.com/v1/ping', - fetch: fetchMock, - }); - await client.send({ package: '@ngaf/langgraph', version: '1.0.0' }); - expect(fetchMock).not.toHaveBeenCalled(); - }); - - it('never throws when fetch rejects', async () => { - const fetchMock = vi.fn().mockRejectedValue(new Error('network down')); - const client = createTelemetryClient({ - endpoint: 'https://telemetry.example.com/v1/ping', - fetch: fetchMock, - }); - await expect( - client.send({ package: '@ngaf/langgraph', version: '1.0.0' }), - ).resolves.toBeUndefined(); - }); -}); diff --git a/libs/licensing/src/lib/telemetry.ts b/libs/licensing/src/lib/telemetry.ts deleted file mode 100644 index d943740ab..000000000 --- a/libs/licensing/src/lib/telemetry.ts +++ /dev/null @@ -1,74 +0,0 @@ -// SPDX-License-Identifier: MIT - -export interface TelemetryEvent { - package: string; - version: string; - licenseId?: string; -} - -export interface TelemetryClient { - send(event: TelemetryEvent): Promise; -} - -export interface CreateTelemetryClientOptions { - endpoint: string; - /** Injected for testability. Defaults to the global `fetch`. */ - fetch?: typeof fetch; - /** Injected for testability. Defaults to `crypto.randomUUID()`. */ - generateInstanceId?: () => string; -} - -function isOptedOut(): boolean { - // Access `process` via globalThis so this module bundles cleanly for - // browser/Angular targets where `process` is not a declared global. - const g = globalThis as { - process?: { env?: Record }; - CACHEPLANE_TELEMETRY?: unknown; - }; - const envFlag = g.process?.env?.['CACHEPLANE_TELEMETRY']; - if (envFlag === '0' || envFlag === 'false') return true; - const override = g.CACHEPLANE_TELEMETRY; - if (override === false || override === 0 || override === '0') return true; - return false; -} - -function defaultInstanceId(): string { - // `crypto.randomUUID` is available in Node 19+, modern browsers, - // and all edge runtimes we target. - return crypto.randomUUID(); -} - -export function createTelemetryClient( - options: CreateTelemetryClientOptions, -): TelemetryClient { - const fetchImpl = options.fetch ?? globalThis.fetch; - const makeId = options.generateInstanceId ?? defaultInstanceId; - const anonInstanceId = makeId(); - - return { - async send(event: TelemetryEvent): Promise { - if (isOptedOut()) return; - if (!fetchImpl) return; - - const body = JSON.stringify({ - package: event.package, - version: event.version, - license_id: event.licenseId, - anon_instance_id: anonInstanceId, - ts: Math.floor(Date.now() / 1000), - }); - - try { - await fetchImpl(options.endpoint, { - method: 'POST', - headers: { 'content-type': 'application/json' }, - body, - // `keepalive` helps in browser unload paths; harmless elsewhere. - keepalive: true, - }); - } catch { - // Never block the host app on telemetry failure. - } - }, - }; -} diff --git a/libs/render/src/lib/provide-render.ts b/libs/render/src/lib/provide-render.ts index af2146bf4..ba34cddc9 100644 --- a/libs/render/src/lib/provide-render.ts +++ b/libs/render/src/lib/provide-render.ts @@ -10,22 +10,14 @@ import { RENDER_LIFECYCLE } from './lifecycle'; import { RenderLifecycleService } from './render-lifecycle.service'; const PACKAGE_NAME = '@ngaf/render'; -declare const __CACHEPLANE_RENDER_VERSION__: string | undefined; -const PACKAGE_VERSION = - typeof __CACHEPLANE_RENDER_VERSION__ !== 'undefined' - ? __CACHEPLANE_RENDER_VERSION__ - : '0.0.0-dev'; -const TELEMETRY_ENDPOINT = 'https://telemetry.cacheplane.dev/v1/ping'; export const RENDER_CONFIG = new InjectionToken('RENDER_CONFIG'); export function provideRender(config: RenderConfig) { void runLicenseCheck({ package: PACKAGE_NAME, - version: PACKAGE_VERSION, token: config.license, publicKey: config.__licensePublicKey ?? LICENSE_PUBLIC_KEY, - telemetryEndpoint: TELEMETRY_ENDPOINT, isNoncommercial: config.__licenseEnvHint?.isNoncommercial ?? inferNoncommercial(), });