Discover how to integrate v0 with ScheduleOnce. Follow our guide with simple, step-by-step instructions for seamless scheduling & improved productivity.
Book a call with an Expert
Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.
scheduleOnce.ts
.scheduleOnce.ts
:
/ Declare ScheduleOnce on the window object to avoid TypeScript errors /
interface Window {
ScheduleOnce: any;
}
/ Function to load the ScheduleOnce embed script and initialize the widget /
export function loadScheduleOnce(bookingUrl: string): void {
/ Create a script element to load ScheduleOnce's embed script /
const script = document.createElement('script');
script.src = 'https://js.scheduleonce.com/embed.js';
script.async = true;
script.onload = () => {
/ Once the script is loaded, initialize the ScheduleOnce widget /
if (window.ScheduleOnce && typeof window.ScheduleOnce.init === 'function') {
window.ScheduleOnce.init({
bookingUrl: bookingUrl,
targetElement: '#scheduleOnceContainer',
/ Additional configuration options can be added here /
});
}
};
document.head.appendChild(script);
}
main.ts
or the entry point of your v0 project).loadScheduleOnce
function from the module you just created.
import { loadScheduleOnce } from './scheduleOnce';
/ Replace 'YOURBOOKINGURL' with your actual ScheduleOnce booking URL /
const bookingUrl = 'YOURBOOKINGURL';
/ Initialize the ScheduleOnce widget when the application loads /
document.addEventListener('DOMContentLoaded', () => {
loadScheduleOnce(bookingUrl);
});
index.html
).
<!-- ScheduleOnce Widget Container -->
<div id="scheduleOnceContainer"></div>
loadScheduleOnce
function.window.ScheduleOnce.init
.When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.