Command palette

@yasinsensoy/web

Web · APIs and utilities

License

Sets the license key.

3 exports

Import

import { setLicenseKey, isLicenseFree, getLicenseStatus } from "@yasinsensoy/web";

Sets the license key. Usually UIProviderProps.licenseKey is enough; in setups that do not use the provider, call this at the app's entry point, before the first paint.

setLicenseKey(key: string | null | undefined): void

Examples

setLicenseKey(import.meta.env.VITE_UI_LICENSE);

Is this a development environment (no license needed)? Either of:

  • A development build on a development host: the bundler's NODE_ENV is "development" or "test", React is its development build (the two must agree, so a forced NODE_ENV is not enough), and the page is on the local machine, the local network, a development domain (.local, .test…), a browser-based IDE or a tunnel (see isDevHost).
  • Any build served from the local machine on an explicit port over http(s), e.g. next start on localhost:3000. Apps that package the site under localhost without a port (Capacitor, Tauri) are not covered.
isLicenseFree(): boolean

Result of the last license check; undefined if no check has run yet or the environment is development.

getLicenseStatus(): LicenseStatus | undefined