Category: developer
Response URL when using a SPA
Because Freddy's script is unaware of URL changes when you're using a SPA, you can pass the response URL manually.
If you haven't already, please read the documentation article about setting options programmatically with
show
and setOptions
here.Important: value of URL
Always use the full URL as a value, like for instance window.location.href
. This way they'll always be clickable. Not only in the dashboard, but also in Slack and email alerts.
Example when using the setOptions
method
window.addEventListener('load', function() {
freddyWidget.setOptions({
url: 'your-url-string-here'
});
});
Example when using the show
method
document.getElementById('my-button').addEventListener('click', function() {
freddyWidget.show({
url: 'your-url-string-here'
});
});
More options
This is the same way as custom fields are set, so everything in one go would look like:
document.getElementById('my-button').addEventListener('click', function() {
freddyWidget.show({
custom_fields: {
user_id: 42,
email: 'customer@example.com'
},
url: 'your-url-string-here'
});
});