# Possible to serve static site without \<script\> tag?

**URL:** <https://forum.builder.io/t/possible-to-serve-static-site-without-script-tag/2994>\
**Category:** Technical Questions\
**Tags:** html\
**Created:** [December 17, 2022, 12:53pm UTC](https://forum.builder.io/t/possible-to-serve-static-site-without-script-tag/2994 "2022-12-17T12:53:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![habbeda](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/habbeda/32/2357_2.png) [@habbeda](https://forum.builder.io/u/habbeda)\
**Post date:** [December 17, 2022, 12:53pm UTC](https://forum.builder.io/t/possible-to-serve-static-site-without-script-tag/2994/1 "2022-12-17T12:53:47Z")

</div>

**Builder content link**

> **[Builder.io: Drag and drop Visual CMS](https://builder.io/content/94d0f5b5621245ebbc1f31f20ac1d911)**
>
> Build and optimize digital experiences for any tech stack, visually.

**Builder public api key**  
61399c2360c74c329313f36c7772806c

**What are you trying to accomplish**  
I wanna serve a static site with no JavaScript.

Yesterday I felt like I almost had it figured out:

1. Query the Builder API at build time to get the site content
2. (Embed that HTML using Astro)
3. Use Webhook to connect Builder to Netlify, so that every edit on Builder triggers a new build and updates the site as per step 1

The problem is that the HTML I’m getting from builder’s API already includes a `<script>` tag and the `<builder-component>` wrapper.

How could I avoid this trip to builder’s cdn for the script? Maybe there is an easy way to get the ‘pure’ HTML without the wrapper?

I feel like I might be missing something fundamental here. Any input would be appreciated!

**Code stack you are integrating Builder with**  
Astro for SSG. Builder’s HTML API to get the HTML.

---

<div class="post-metadata">

**Author:** ![habbeda](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/habbeda/32/2357_2.png) [@habbeda](https://forum.builder.io/u/habbeda)\
**Post date:** [December 20, 2022, 11:32am UTC](https://forum.builder.io/t/possible-to-serve-static-site-without-script-tag/2994/2 "2022-12-20T11:32:26Z")

</div>

To bump and elaborate.  
I have:

```auto
// index.astro

const { data: pageData } = await fetch('https://cdn.builder.io/api/v1/html/MY_PAGE_MODEL?apiKey=${apiKey}'
)
//...

<Fragment set:html={pageData.html} />

```

which generates HTML like

```auto
// index.html

<builder-component ... name="MY_PAGE_MODEL" ...>

// ...styles and HTML...

</builder-component>
<script async src="https://cdn.builder.io/js/webcomponents"></script>

```

So then the client has to fetch the `webcomponents` script, even tho it’s a totally static site made of text and images.  
I’d just like to improve performance a bit. Is there an easy way to not embed this script tag?

---

<div class="post-metadata">

**Author:** ![habbeda](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/habbeda/32/2357_2.png) [@habbeda](https://forum.builder.io/u/habbeda)\
**Post date:** [December 20, 2022, 1:23pm UTC](https://forum.builder.io/t/possible-to-serve-static-site-without-script-tag/2994/3 "2022-12-20T13:23:23Z")

</div>

❗ UPDATE  
I got it working using the `Qwik API` (not the `HTML API`).

Thanks for the folks on the Discord for pointing me in the right direction!

* * *

Working code:

```auto
// index.astro

const encodedUrl = encodeURIComponent(''); //empty string - not sure if necessary, but seems to work

// use /api/v1/qwik instead of /html 
const { html: pageHTML } = await fetch(
  `https://cdn.builder.io/api/v1/qwik/homepage?apiKey=${apiKey}&url=${encodedUrl}&cachebust=true`
)
  .then((res) => res.json())
  .catch(handleError);

---
<Layout>
    <Fragment set:html={pageHTML} />
</Layout>

```

---

<div class="post-metadata">

**Author:** ![arafatdev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/arafatdev/32/4448_2.png) [@arafatdev](https://forum.builder.io/u/arafatdev)\
**Post date:** [December 2, 2024, 9:18am UTC](https://forum.builder.io/t/possible-to-serve-static-site-without-script-tag/2994/4 "2024-12-02T09:18:43Z")

</div>

You can use [https://statichost.host](https://statichost.host) for hassle free static experience.
