Embed your schedule on your website (Beta)
Beta — show your class schedule and prices on your own website, with Book and Buy buttons that open your booking site. Off by default; we switch it on for you.
Beta: embedding is an early feature. It is off for every gym, and there is no switch in Settings yet — we turn it on for your gym from our side. Ask us, tell us your website address, and we will set it up. What follows is exactly what works today.
In the examples below, https://yourstudio.example is your gym’s own website and https://yourstudio.fitnito.com is your Fitnito booking site. Use your real addresses.
Before you start: your website address
Embedding only works on the websites you tell us about. For each one, give us the bare address, starting with https://:
https://yourstudio.exampleworks.https://www.yourstudio.exampleis a different address. If your site opens with and withoutwww, list both.- No page path (
https://yourstudio.example/schedule), nohttp://, no wildcards (https://.yourstudio.example), and no. Those are refused.
On our side this is two gym settings: embed_enabled (off by default) and embed_allowed_origins, the list of addresses. We set both for your gym from our side. Until both are set, the embed pages on your booking site (/embed/schedule, /embed/schedule.json, /embed/prices.json, /embed/widget.js, and the Book and Buy links) answer “not found” (404), and nothing else on your booking site changes.
Once embedding is on, three small things also change on your booking site itself, so members who arrive from your website can finish signing up:
- In a class window, a signed-in member with no pass that covers the class sees View passes & memberships (or a note to ask the gym, if nothing is for sale) instead of Reserve. After buying, they come back to that class.
- A signed-in member with no pass sees View passes & memberships on Home, when your gym sells a plan or pack there.
- The welcome text on Home is left-aligned.
Option 1: the schedule element (fits your site’s look)
This drops your schedule and prices straight into your page. It picks up your website’s own font and text colour.
- Paste this once in your page, for example near the end of the page:
<script src="https://yourstudio.fitnito.com/embed/widget.js" defer></script> - Put this where the schedule should appear:
<fitnito-schedule view="both"></fitnito-schedule> - Pick what it shows with
view:schedule(classes only),prices(plans and class packs only), orboth. - Save and open your page. You should see the next 7 days of classes, each with a Book button, and your prices with Buy buttons.
How it works: the element is a standard web component named fitnito-schedule. It reads https://yourstudio.fitnito.com/embed/schedule.json and https://yourstudio.fitnito.com/embed/prices.json and draws them inside its own Shadow DOM, so your site’s styles and ours do not clash. It only shows what a visitor who is not signed in already sees on your booking site: class times, class names, coaches, and spots left where your schedule shows them. No member names or bookings.
Prices only appear once your booking site can take card payments, and only for plans and packs you list on your booking site. Changes can take up to 5 minutes to show, because the schedule is cached for 5 minutes.
To match your colours, set these on the element in your site’s CSS:
--fitnito-primary: the Book and Buy button colour and the day accent.--fitnito-on-primary: the button text colour (white by default).--fitnito-font: the button and heading font.--fitnito-radius: how round the buttons are.
For example: <style>fitnito-schedule { --fitnito-primary: #2f6f62; --fitnito-radius: 1rem; }</style>
You can change the words too, with the attributes book-text, buy-text, prices-title, loading-text, error-text, spots-text (the words after the number of spots left, “spots left” by default), and empty-text (shown when a week has no classes). Day names and dates follow the visitor’s browser language. For example: <fitnito-schedule view="schedule" book-text="Reserve"></fitnito-schedule>
Book and Buy open your booking site in a new tab.
Option 2: the schedule iframe (drop-in)
If your website builder only lets you add an iframe, use the ready-made page at https://yourstudio.fitnito.com/embed/schedule. It shows your logo and gym name, one week of classes with previous and next week links, a Reserve button on each class, and Sign in (plus Register if you let members sign themselves up).
- Add the iframe:
<iframe id="fitnito-schedule" src="https://yourstudio.fitnito.com/embed/schedule" style="width:100%;border:0" height="600" title="Class schedule" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"></iframe> - Optional, so the iframe grows to fit the week instead of scrolling, add this script on the same page:
<script>window.addEventListener("message", (event) => { if (event.origin !== "https://yourstudio.fitnito.com") return; if (event.data?.type !== "fitnito:embed:resize") return; document.getElementById("fitnito-schedule").height = event.data.height })</script> - Want the dark look? Add
?theme=darkto the address:https://yourstudio.fitnito.com/embed/schedule?theme=dark. Anything else is the light look.
The sandbox line lets the schedule run its own scripts and open your booking site, but only after a visitor clicks. The resize script checks that the message really comes from https://yourstudio.fitnito.com before it changes anything. The schedule only sends its height to a website on your list.
Reserve, Sign in, and Register open your booking site in the whole browser window (target="_top"), not inside the iframe.
Colours, font, and corners
The iframe does not take your own CSS. Instead, you pick from a short list of design tokens and we set them for you:
- Main colour, background colour, and text colour (
embed_primary_color,embed_background_color,embed_text_color): each a hex colour like#2f6f62. Leave one blank to keep the default. - Font (
embed_font_preset):inherit,system,serif, orrounded. - Corners (
embed_radius):none,small, orlarge.
The iframe turns these into the CSS custom properties --fitnito-primary, --fitnito-background, --fitnito-text, --fitnito-font, and --fitnito-radius. Raw CSS is never accepted, which keeps your booking site safe.
What stays locked down
- Only your listed addresses can show the iframe. That one page sends
Content-Security-Policy: frame-ancestorswith your addresses and dropsX-Frame-Options. Every other page on your booking site keepsX-Frame-Options: SAMEORIGIN, so nobody can frame your login or checkout. - The schedule and price data answer only your listed addresses, by exact match (
Access-Control-Allow-Originis never*, withVary: Origin). No login cookie is sent or set, so your website never sees who is signed in. - Turn embedding off, or remove every address, and the embed pages and Book and Buy links go back to “not found”.
Book and Buy: why they open your booking site
Signing in and paying happen on your booking site, in its own tab or full window, never inside your website. Your members’ login cookie is set to SameSite=Lax, so browsers do not send it inside an iframe on another website. Safari blocks it too. Stripe Checkout also runs on its own page. Opening the booking site at the top is what lets members actually sign in and pay.
Each button goes to a link that remembers the class or plan the visitor picked:
- Book or Reserve goes to
https://yourstudio.fitnito.com/embed/book/{class}?date=YYYY-MM-DD. A signed-in member lands on your schedule with that class open, ready for Reserve (or Book now for a paid drop-in). - Buy goes to
https://yourstudio.fitnito.com/embed/buy/plan/{plan}orhttps://yourstudio.fitnito.com/embed/buy/pack/{pack}. A signed-in member sees that one plan or pack with its Subscribe or Buy pass button, then pays in Stripe Checkout.
Not signed in yet? They go to the sign-up page (or the sign-in page if your gym is invite-only), and right after signing up or signing in — with a password, an emailed sign-in link, or Google — they come straight back to the class or plan they picked.
Tip: the Fitnito-built links in the schedule are the ones to use. You do not need to build these addresses yourself.