product-fruits
v1.1.0
Published
Official npm wrapper for installing Product Fruits in browser environments. A thin loader that injects the Product Fruits script and exposes a typed init/safeExec API. TypeScript supported.
Maintainers
Readme
Product Fruits npm package
A thin npm wrapper for installing Product Fruits in browser environments. It injects the Product Fruits script and exposes a small typed API (init / safeExec). The package supports TypeScript.
Instructions
- Install this package
npm install product-fruits --save- Use this package
import { productFruits } from 'product-fruits';
// Call this later in your code; it can be called only once.
// This will load Product Fruits content immediatelly.
// Pass the real username of the current user. Read our docs for more options.
productFruits.init('YOUR PROJECT CODE', 'LANGUAGE CODE', { username: '<<REPLACE>>' });Compatibility
The package is framework-agnostic. It ships as an ES module with TypeScript
typings (types.d.ts) and has zero runtime dependencies. It works in any
modern browser bundler/toolchain (Vite, webpack, Rollup, esbuild, Next.js, etc.)
and with any frontend framework (React, Angular, Vue, Svelte, plain JS). Because
it must run in the browser, import it only in client-side code (guard against
server-side rendering / SSG).
Versioning, releases & security
- Changelog / releases: every npm version has a matching GitHub Release with notes. The latest version published on npm is the recommended version for production.
- Provenance: each release is published from CI with npm provenance, so the
published package is verifiably built from this repository (
npm audit signatures). - Security policy & vulnerability reporting: see SECURITY.md.
More docs
Read more at https://help.productfruits.com/en/article/npm-package
