What is the Partner SDK?
The ActionModel Partner SDK lets you embed the ActionFi training widget directly into your website or application. Instead of sending users to the ActionFi dashboard, they can discover and complete training tasks right inside your platform.Seamless Integration
User Attribution
Custom Theming
Quick Start
Get the widget running in under 5 minutes with this minimal setup.Step 0: Configure npm Access (Private Package)
-
Request a token: contact the partner onboarding team and ask for an npm deploy token with
read_package_registryscope for the Partner SDK. -
Add
.npmrc(project root) or~/.npmrc(global):
- Export the token (local dev):
Add the Container
div element where you want the widget to appear. Give it enough height for the task list.Load the SDK
Initialize the Widget
ActionModel.init() with your Partner ID to render the widget.Complete Quick Start Example
Installation
- Script Tag (Recommended)
- npm (Recommended)
CDN Installation
The simplest way to add the SDK is via our CDN. Add this script tag to your HTML:ActionModel object on window that you can use to initialize widgets.<body> or use the defer attribute to ensure the DOM is ready before initialization.Configuration Options
TheActionModel.init() function accepts a configuration object with the following options:
Required Options
Optional Options
Basic Configuration Example
Basic Configuration Example
Full Configuration Example
Full Configuration Example
Domain Filtering
Domain Filtering
- Your widget is on a different subdomain than where tasks are completed
- You want to preview tasks from another domain during development
Bounty Filtering
Bounty Filtering
TypeScript Interfaces
For TypeScript projects, these are the public types exported by the SDK (authoritative for npm installs):View TypeScript Interfaces
View TypeScript Interfaces
User Identification
Link task completions to your users for attribution and analytics. When you identify users, their completions are permanently mapped to your internal user ID.User Object Properties
Basic User Identification
Full User Identification
metadata object can contain any JSON-serializable data. Use it to segment users in your analytics, personalize experiences, or track attribution across your systems.Dynamic User Identification
If your user logs in after the widget is initialized, destroy and reinitialize:Theming
Customize the widget to match your brand. Thetheme option supports mode, semantic tokens (sys), component tokens (comp), border radius, and font family.
- Presets
- Helpers
- Common Overrides (sys)
- Component Overrides (comp)
Presets
Events
Subscribe to widget events for analytics, custom behavior, or debugging.Event Handler Setup
Event Types Reference
Event Handling Examples
Analytics Integration
Analytics Integration
Extension Install Prompt
Extension Install Prompt
Error Handling
Error Handling
Task Completion Tracking
Task Completion Tracking
Configuring Webhooks
What’s Coming
Task Completion Webhooks
User Activity Events
Secure Signatures
Retry Logic
Interested in Early Access?
Contact the partner onboarding team to discuss webhook integration for your platform.Instance Methods
Theinit() function returns a widget instance with methods for controlling the widget.
refresh()
Reload tasks from the server. Useful after user actions that might affect available tasks.
destroy()
Remove the widget and clean up all event listeners. Always call this before reinitializing or when the widget is no longer needed.
ActionModel.destroyAll()
Static method to destroy all widget instances on the page. Useful in single-page applications.
Framework Integration
- React
- Next.js
- Vue 3
- Angular
React Integration
Use the React wrapper from@actionmodel/partner-sdk/react.Requirements
Before integrating the Partner SDK, ensure you have:Partner Integration
partnerId must be configured in the ActionModel system. Contact the partner onboarding team to get started.Domain Whitelisting
Browser Extension
HTTPS Required
localhost is supported.Supported Browsers
The ActionModel browser extension supports:Troubleshooting
npm install fails (401/403/404)
npm install fails (401/403/404)
npm install @actionmodel/partner-sdk fails with authentication or not found errors.Fix: Configure .npmrc for the private registry and provide a token from ActionModel.Widget shows 'Extension Not Found'
Widget shows 'Extension Not Found'
- Ensure extension is installed: Users must install the ActionModel browser extension from the Chrome Web Store
- Check browser compatibility: The extension supports Chrome-family browsers (Chrome, Edge, Brave, Arc, Opera, Mises)
-
Verify extension is enabled: Check
chrome://extensionsto ensure it’s not disabled -
Try refreshing: Sometimes the extension takes a moment to register. Call
widget.refresh()or reload the page
Widget shows 'Access Denied'
Widget shows 'Access Denied'
- Verify your partnerId: Ensure the Partner ID is correct and matches what was provided
- Check domain whitelisting: Your domain must be allowed in your partner configuration
- Confirm partner status: Ensure your partner integration is active and enabled
- Contact support: Contact the partner onboarding team with your Partner ID and domain
No tasks appear in the widget
No tasks appear in the widget
-
Verify domain configuration: Ensure tasks are configured for your domain or the specified
domainparameter - Check bountyId: If filtering by bounty, verify the bounty ID is correct
-
Listen for errors: Add an
onEventhandler and check fortasks_load_failedevents - Network issues: Check browser console for network errors
SSR Errors (Next.js, Nuxt, etc.)
SSR Errors (Next.js, Nuxt, etc.)
Widget not rendering
Widget not rendering
-
Check container exists: Ensure the container element exists in the DOM before calling
init() - Script loaded: Verify the SDK script has loaded before initialization
- Console errors: Check browser console for JavaScript errors
- Container size: Ensure the container has dimensions (min-height, width)
Enable Debug Mode
Enable Debug Mode
- SDK initialization
- Extension detection
- API requests and responses
- Event emissions
docs/ERROR_CODES.md in the SDK repo.Frequently Asked Questions
Can I customize which tasks appear?
Can I customize which tasks appear?
- Domain filtering: Set the
domainparameter to show tasks for a specific domain - Bounty filtering: Set the
bountyIdparameter to show only tasks from a specific campaign - Custom task configuration: Work with our team to define custom tasks for your integration
How do I track user completions?
How do I track user completions?
user parameter to identify your users:Can I use multiple widgets on one page?
Can I use multiple widgets on one page?
ActionModel.destroyAll() to clean up all instances at once.Is there a sandbox/test environment?
Is there a sandbox/test environment?
What data is collected?
What data is collected?
- Widget initialization events
- Task interaction events (start, complete, fail)
- User identification data you provide
Support
Documentation
Partner Support
Getting Help
- Documentation: docs.actionmodel.com
- Partner Support: Partner onboarding team
- Technical Issues: Include your Partner ID, domain, and browser console logs when reporting issues
Related Resources
ActionFi Overview
For Platforms
Browser Extension
Ready to integrate? Contact the partner onboarding team to get your Partner ID and start embedding the widget into your platform.