boominjs
v0.3.3
Published
Browser SDK for Boomin Creator Connect.
Maintainers
Readme
boominjs
Browser SDK for Boomin Creator Connect.
Install
npm install boominjs
npx boominjs initnpx boominjs init opens Boomin in your browser, creates or selects a creator program, adds localhost origins, and writes:
VITE_BOOMIN_PUBLIC_KEY=...
VITE_BOOMIN_PROGRAM_ID=...
VITE_BOOMIN_API_BASE=https://api.boomin.ai/v1/connectCLI
The CLI is built for humans and agents. Every command supports -h / --help, and structured commands support --json.
npx boominjs --help
npx boominjs scopes
npx boominjs scopes explain units:create
npx boominjs token create --name "Unit Agent" --scopes org:read,units:read,units:create,units:delete
npx boominjs token list
npx boominjs platform smoke --read-only --token sk_boomin_live_...
npx boominjs platform smoke --write --cleanup --token sk_boomin_live_...Platform tokens are private server-side credentials for agents and automation. Do not put sk_boomin_live_... tokens in browser code. Creator Connect public keys (pk_live_...) remain the frontend-safe keys for signup and Instagram OAuth.
import Boomin from "boominjs";
Boomin.init({
publicKey: import.meta.env.VITE_BOOMIN_PUBLIC_KEY,
programId: import.meta.env.VITE_BOOMIN_PROGRAM_ID,
apiBase: import.meta.env.VITE_BOOMIN_API_BASE,
redirectUri: window.location.origin + window.location.pathname,
});
await Boomin.requestOtp({
email: "[email protected]",
name: "Creator Name"
});
const creator = await Boomin.verifyOtp({
email: "[email protected]",
code: "123456"
});
console.log(creator.status); // pending
document.querySelector("#connect-instagram").addEventListener("click", async () => {
Boomin.connectInstagram({
requireCreator: true,
referralCode: new URLSearchParams(window.location.search).get("ref"),
metadata: { source: "creator_program_page" },
});
});CDN
<script src="https://cdn.boomin.ai/boomin-connect.js"></script>
<script>
window.Boomin.init({
publicKey: "pk_live_your_program",
programId: "your-program-id",
redirectUri: window.location.href
});
window.Boomin.attachConnectButton("#connect-instagram", {
label: "Connect Instagram",
pendingLabel: "Pending approval",
requireCreator: true
});
</script>Events
Boomin.on("connect:pending_approval", (status) => {
console.log("Creator connected and is waiting for approval", status);
});
Boomin.on("connect:error", (error) => {
console.error(error);
});Account-first flow
[email protected] supports the recommended creator flow:
Boomin.requestOtp({ email, name })Boomin.verifyOtp({ email, code })Boomin.connectInstagram({ requireCreator: true })Boomin.getConnectStatus(sessionId)
After OTP verification, the SDK stores the creator token in browser storage scoped to the public key and automatically attaches it when starting Instagram OAuth.
The SDK intentionally ships without required button styling. Use your own markup and CSS, or use attachConnectButton for state management while keeping full control of the visual design.
