Quickstart
Before you start
Section titled “Before you start”Create a BugFence project and copy its public project key and report endpoint. Use only a public project key in browser code. Never put a project secret, admin key, or AI provider key in a frontend application.
React and Next.js
Section titled “React and Next.js”The React package is currently published to GitHub Packages. Installation requires a GitHub token with read:packages; npmjs anonymous installation is not currently available.
Add these lines to your user-level .npmrc or the project .npmrc (do not commit a token):
@social-pulse-crm:registry=https://npm.pkg.github.com//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}Set GITHUB_TOKEN in your shell or secret manager to a GitHub token with package-read access, then install:
npm install @social-pulse-crm/bugfence-reactWrap the client application in BugFenceProvider:
'use client';
import { BugFenceProvider } from '@social-pulse-crm/bugfence-react';
export function BugFenceRoot({ children }: { children: React.ReactNode }) { return ( <BugFenceProvider config={{ projectKey: process.env.NEXT_PUBLIC_BUGFENCE_KEY!, endpoint: process.env.NEXT_PUBLIC_BUGFENCE_ENDPOINT!, lazyWidget: true }} > {children} </BugFenceProvider> );}For the full integration, see React and Next.js.
Vanilla JavaScript
Section titled “Vanilla JavaScript”Load the SDK from your BugFence server and initialize it after the script loads:
<script src="https://bugs.example.com/sdk/bugfence.min.js" defer></script><script> window.addEventListener('DOMContentLoaded', () => { BugFence.init({ projectKey: 'pk_live_your_public_key', endpoint: 'https://bugs.example.com/api/v1/reports' }); });</script>Replace the example host, endpoint, and key with your project values. See Vanilla JavaScript.
What happens next
Section titled “What happens next”The SDK shows a report launcher. Forms and studio are loaded when the widget mounts; recording annotations are loaded when a screen recording starts. You can disable or self-host those add-ons in Add-ons.