-
-
Save derrickreimer/e4e6eeca08ab38f190daebcafb52f35e to your computer and use it in GitHub Desktop.
Framer Component for SavvyCal inline embedding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect } from "react" | |
declare global { | |
interface Window { | |
SavvyCal: API | |
} | |
} | |
interface API { | |
(...args: any[]): void | |
} | |
export default function SavvyCal(props) { | |
useEffect(() => { | |
const embedScript = document.createElement("script") | |
const firstScript = | |
document.getElementsByTagName("script")[0] || | |
document.querySelector("body") | |
embedScript.async = true | |
embedScript.src = "https://embed.savvycal.com/v1/embed.js" | |
embedScript.onload = () => { | |
try { | |
window.SavvyCal("init") | |
} catch {} | |
// Replace `link` with your scope/slug | |
window.SavvyCal("inline", { | |
link: "REPLACE_WITH_SCOPE/REPLACE_WITH_LINK", | |
selector: "#booking-page", | |
}) | |
} | |
firstScript.parentNode.insertBefore(embedScript, firstScript) | |
}, []) | |
return <div id="booking-page"></div> | |
} |
Hi @tomelliot, the height of the iframe is managed by the embed script itself (by passing messages between the parent window and the iframe). Looks like something is not quite working right here, but hard to tell what the culprit would be at first glance. By chance do you have a public page I can take a look at to inspect the source?
@derrickreimer unfortunately the webapp is a bit hard to share a link to - I've just submitted a support ticket with a screen share and some more info (and so you don't have to have this conversation in github comments).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@derrickreimer I'm borrowing this to embed my scheduling page inside a web app. Two quick questions:
hideBanner
parameter to work. I'm assuming that's for hiding the panel on the left with the title, attendees, date picker etc? Is that broken, or am I doing something wrong?return ( <div className={clsx("h-[600px] bg-green-500")} id="booking-page"></div> );