Installation
Choose the installation method that works best for your setup.
CDN Installation
The easiest way to add FitSignal to any website. No build step required.
1. Add the script tag
Add this script to your HTML, either in the <head> or before the closing </body> tag.
<!-- Add to your HTML <head> or before </body> -->
<script src="https://www.fitsignal.com/sdk/fitsignal.umd.js"></script>2. Initialize the SDK
<script>
// Initialize when the SDK is loaded
FitSignal.init({
apiKey: 'fs_live_your_api_key',
position: 'bottom-right', // optional
debug: false // optional
});
</script>Benefits of CDN
- • No build configuration needed
- • Works with any website (WordPress, Shopify, etc.)
- • Automatically gets the latest version
- • Fast global CDN delivery
npm Installation
Install via npm for React, Vue, Angular, or other JavaScript frameworks.
1. Install the package
npm
npm install @fitsignal/widget-sdkyarn
yarn add @fitsignal/widget-sdkpnpm
pnpm add @fitsignal/widget-sdk2. Import and use
import { FitSignal } from '@fitsignal/widget-sdk';
// Initialize the SDK
FitSignal.init({
apiKey: 'fs_live_your_api_key',
position: 'bottom-right',
debug: false
});
// Identify your user
FitSignal.identify({
email: 'user@example.com',
name: 'John Doe'
});TypeScript Support
The SDK includes TypeScript definitions out of the box. No additional@typespackage needed.
import type { FitSignalOptions, IdentifyUser } from '@fitsignal/widget-sdk';
const options: FitSignalOptions = {
apiKey: 'fs_live_your_api_key',
position: 'bottom-right'
};
const user: IdentifyUser = {
email: 'user@example.com',
name: 'John Doe',
externalId: 'user_123',
attributes: {
plan: 'pro',
company: 'Acme Inc'
}
};Browser Compatibility
The FitSignal Widget SDK supports all modern browsers:
| Browser | Minimum Version |
|---|---|
| Chrome | 60+ |
| Firefox | 55+ |
| Safari | 11+ |
| Edge | 79+ |
| Mobile Safari | iOS 11+ |
| Chrome for Android | 60+ |
Internet Explorer
Internet Explorer is not supported. Consider using a polyfill service if you need to support legacy browsers.
Content Security Policy
If your site uses Content Security Policy headers, add the following directives:
script-src 'self' https://www.fitsignal.com;
frame-src 'self' https://www.fitsignal.com;
connect-src 'self' https://www.fitsignal.com;