This documentation explains how to integrate the Orka chat widget into your Shopify application. Choose the integration method based on your development framework.
This approach uses the script directly in your root.tsx file.
Add the script to your App component in root.tsx:
Standard Integration (Without Remix)
If you're not using Remix, you have several options for integrating the Orka widget:
Basic Integration
Add the following script to the <head> section of your HTML:
Auto-Loading Configuration
By default, the widget loads automatically when the script is included. You can prevent this automatic loading by setting the ORKA_LOAD option to false:
If you disable auto-loading, you'll need to initialize the widget manually:
YOUR_APP_ID: Replace with your application ID
appType: (Optional) Specify "Shopify" or "Standalone"
Single Page Application Integration
If you're using a Single Page Application (SPA), you can use the npm package:
Install the package:
Initialize the widget:
Session Configuration
You can configure session data for any integration method:
Important: Insert the ORKA_SESSION configuration before the main Orka script.
API Methods
update(data)
Updates the session data for the chat widget.
reset()
Resets the chat session and updates context information.
Closes the current chat
Sends the current page's title and URL as context
toggle()
Toggles the widget visibility.
show(message)
Opens the chat widget with an optional pre-filled message.
hide()
Closes the chat widget.
destroy()
Removes the widget instance from the page.
Complete Integration Example
Here's a full example showing how to integrate the widget with various features:
Troubleshooting
Common Issues
Widget not loading:
Verify that the SDK script URL is correct
Check that your APP_ID is valid
Ensure the script is loaded after the DOM
Check if auto-loading is disabled (ORKA_LOAD = false)
API calls failing:
Check the browser console for errors
Make sure the widget is fully initialized before calling methods
Verify that methods are called after DOM content is loaded