Skip to main content
Scaffold only. The CLI writes a starter file with a placeholder; you still need to add the script tag (or import it from your bundler entry point) yourself.

Install with the CLI

Pick Vanilla JavaScript when prompted.

Manual setup

1

Install the SDK

2

Create an init file

lucent-init.js:
3

Import from your app entry

If you’re using a bundler (Vite, Webpack, esbuild, Parcel…), import the file from your main entry point so it runs once when the page loads:

Loading without a bundler

If you don’t use a bundler, load the SDK from a CDN with an ESM <script>:
The CDN form is convenient for quick tests but adds a round‑trip on first page load. For production use, bundle @lucenthq/sdk into your app.

Notes

  • Replace "luc_pk_..." with a real key. Reading it from an env var is your bundler’s job — e.g. process.env.LUCENT_PUBLIC_KEY with Webpack’s DefinePlugin, or import.meta.env.VITE_LUCENT_PUBLIC_KEY with Vite.
  • For TypeScript projects, @lucenthq/sdk ships its own types — no @types/* package needed.
  • If you’re using React, Vue, Svelte, or one of the other supported frameworks, use the dedicated framework page instead of this one.