Skip to content

Instantly share code, notes, and snippets.

@ShariqT
Last active November 19, 2021 05:52
Show Gist options
  • Save ShariqT/516a2b1db0f6c0f7e8a115fb4717fbbb to your computer and use it in GitHub Desktop.
Save ShariqT/516a2b1db0f6c0f7e8a115fb4717fbbb to your computer and use it in GitHub Desktop.
CreatePostcard
onMounted(() => {
fetch("http://localhost:3030/templates")
.then((data) => data.json())
.then((data) => templates.value = data);
const script = document.createElement("script");
script.src = "https://cdn.lob.com/lob-address-elements/2.1.3/lob-address-elements.min.js";
script.async = true;
script.setAttribute("data-lob-key", import.meta.env.VITE_LOB_API_KEY);
script.setAttribute("data-lob-primary-id", "firstLine");
script.setAttribute("data-lob-secondary-id", "secondLine");
script.setAttribute("data-lob-city-id", "city");
script.setAttribute("data-lob-state-id", "state");
script.setAttribute("data-lob-zip-id", "zip");
document.body.appendChild(script);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment