Static sites
API key exposure
CAUTION! This way exposes your API key to the public. Meaning someone who knows where to look will be able to find your page API key. If they aslo know your text names. They will be able to fetch your text values!
There is a way to use EditeEase on completly static sites, meaning it can be used with plain HTML files.
This method poses a security threat since HTML does not have a secure storage for your API key.
NOTE: EditEase for static sites uses WebComponents. Some older browsers do not support WebComponents.
Usage
First you will need to include editease.js
through a <script>
tag.
In the <head>
of the document you will add the page API key via a custom <ee-api-key>
HTML element. In the element you can pass ypur API key throught the key
attribute.
To use the text. Use the <ee-text>
HTML element with the name
attribute equal to your text name.
The HTML element will be replaced with one of the following values:
<TEXT_VALUE>
- Successfully retrieved text valueEditEase text for '<TEXT_NAME>' not found
- The text with name <LABEL> could not be found on the pageWrong EditEase API key
- If the key was found but it is not correct (no page has such key)Unauthorized API call
- If there is no API keyUnsuccessfull API cal
- If the request has bad parameters
Example
Lets say we have a page with API key
my-api-key
and a text with namemy-text
and valueLorem ipsum dolor sit amet
.An example of a HTML file