Journeybee forms can be embedded into any website or application while maintaining full functionality and customization options.
Quick Start
Add Journeybee forms to your website in three steps:
<!-- 1. Add the embed script -->
< script src = "https://forms.journeybee.io/api/embed" ></ script >
<!-- 2. Add a container -->
< div id = "form-container" ></ div >
<!-- 3. Initialize the form -->
< script >
journeybee (
"init" ,
"your-form-uuid" ,
document . getElementById ( "form-container" )
);
</ script >
Installation Options
Direct Script
React Component
Vue Component
Configuration
The journeybee()
function accepts the following parameters:
Your form’s unique identifier
The container element where the form will be rendered
Configuration options for the form
Your company name (defaults to ‘journeybee’)
Theme and layout customization options
Pre-filled form field values
Callback when form is ready
Callback on successful submission
Callback on form validation
Customization
Embedding Methods
Basic Modal
HTML Modal Example
React Modal Example
< div class = "my-form-container" >
< div id = "inline-form" ></ div >
</ div >
< script >
document . addEventListener ( "DOMContentLoaded" , () => {
journeybee ( "init" , "form-uuid" , document . getElementById ( "inline-form" ), {
customization: {
theme: {
colors: {
primary: "#0066cc" ,
},
},
},
});
});
</ script >
Events
journeybee ( "init" , "form-uuid" , container , {
// Form is ready to receive input
onReady : () => {
console . log ( "Form is ready" );
},
// Form validation status
onValidation : ( data ) => {
console . log ( "Validation:" , data . isValid , data . errors );
},
// Form submitted successfully
onSuccess : ( data ) => {
console . log ( "Form submitted:" , data );
},
// Form encountered an error
onError : ( error ) => {
console . error ( "Form error:" , error );
},
});
Communication API
// Get form instance
const form = journeybee ( "init" , "form-uuid" , container );
// Update form customization
form . updateCustomization ({
theme: {
colors: {
primary: "#00ff00" ,
},
},
});
// Update form data
form . setFormData ({
email: "new@example.com" ,
});
// Update styles
form . setStyle ({
".form-input" : "border-color: #0066cc;" ,
});
// Cleanup
form . destroy ();
Advanced Usage
journeybee ( "init" , "form-uuid" , container , {
prefill: {
email: "user@example.com" ,
company_name: "Acme Inc" ,
custom_field_uuid: "Custom Value" ,
},
});
Debug Mode
journeybee ( "init" , "form-uuid" , container , {
debug: true ,
onReady : () => {
console . log ( "Form ready - check console for debug logs" );
},
});
Error Handling
When embedding Journeybee forms, you’ll receive detailed error information through the onError
callback. Here are the possible error codes and their meanings:
Error Codes
Code Description INVALID_FORM
The form UUID is invalid or missing NO_FORM_FOUND
The specified form could not be found MISSING_CONTACT
Neither email nor phone number was provided DUPLICATE_LEAD
This lead has already been submitted INVALID_PARTNERSHIP
Invalid partnership configuration or domain SERVER_ERROR
An unexpected server error occurred NETWORK_ERROR
Failed to connect to the server
Example Error Handling
journeybee ( "init" , "form-uuid" , container , {
onError : ( error ) => {
// error = {
// code: string,
// message: string,
// details?: object // Only in development mode
// }
switch ( error . code ) {
case "DUPLICATE_LEAD" :
alert ( "This lead has already been submitted" );
break ;
case "MISSING_CONTACT" :
alert ( "Please provide either an email or phone number" );
break ;
Frontend Validation
The form performs immediate validation before submission for:
Required contact information (email or phone)
Partner company selection when required
Partner email address when required
Backend Validation
The server validates:
Form existence and accessibility
Partnership configurations
Duplicate lead submissions
Data integrity and constraints
Browser Support
Chrome (latest 2 versions)
Firefox (latest 2 versions)
Safari (latest 2 versions)
Troubleshooting