Script tag
Installing Saltfish: Script tag
1. Import Saltfish
Include the provided Saltfish Player JavaScript file in your website's HTML, typically before the closing </body> tag.
<script src="https://storage.saltfish.ai/player/player.js"></script>2. Initialize Saltfish
In your application's JavaScript, initialize the player using your unique API token. This should typically happen once when your application loads.
// Basic initialization
saltfish.init('YOUR_UNIQUE_API_TOKEN');
// Initialization with options
saltfish.init({
token: 'YOUR_UNIQUE_API_TOKEN',
persistence: true, // Remember user progress between visits. Default: false
sessionRecording: false // Enable detailed session recording. Default: false
)}Remember to replace 'YOUR_UNIQUE_API_TOKEN' with your unique API token: https://studio.saltfish.ai/settings
3. Identify your users
To track individual user progress, personalize experiences and leverage analytics effectively, identify users when they log in or their identity becomes known.
3.1 Website: IdentifyAnonymous
3.2 In-product: Identify
language (optional) Specifies the preferred language for the user interface.
Possible values:
Any valid ISO 639-1 language code (e.g.
'en','sv','de','fr', etc.)'auto'(default) — automatically detects the user’s language
💡 Note: The
languagesetting only takes effect if the playing playlist includes translations/localizations for that language.
Last updated