@softconst/instantbase-js
v2.0.1
Published
Minimal InstantBase client for sending user events
Downloads
357
Maintainers
Readme
@softconstructor/instantbase-js
A minimal JavaScript client for sending user events to InstantBase — a system for building digital customer profiles.
This library automatically:
- Generates and stores a unique client identifier (
InstantBaseAccount) in a cookie, - Attaches it to every request,
- Sends data to the InstantBase API.
Works with any frontend framework: Nuxt 3, Vue, React, Svelte, vanilla HTML, and more.
📦 Installation
npm install @softconstructor/instantbase-js import { init, send } from '@softconstructor/instantbase-js';
interface Config {
token: string; // required
debug?: boolean; // optional
}
init({
token: 'YOUR_APPLICATION_SECRET_TOKEN', // ← get this from your InstantBase admin
debug: true // optional: logs events to console
});
import { send } from '@softconstructor/instantbase-js';
// Page view
send({ URL: window.location.href });