Widgets
Embeddable scripts for your website
Last updated
Was this helpful?
Embeddable scripts for your website
Last updated
Was this helpful?
Need to integrate any of the studio endpoints on your website quickly? You might be looking for AstronomyAPI Widgets.
Widgets script can be loaded to your webpage by including a script tag inside the <HEAD></HEAD>
tags, as shown below. Make sure to update the yourEncryptedAuthString
with the base64 string you created as mentioned in the . Notice how the string should not include the term Basic
.
A <DIV> tag is required to populate the widget. By default, the element id must be moon-phase
or star-chart
, depending on the type of widget you need.
The client instance is created using new AstronomyAPI({...options})
. The parameter basicToken
is required to initiate the class.
A callback function can be passed as the second parameter for each method. The callback function will be passed with the original response received from the API.
A full list of examples could be found in the
All methods follow the same payload body as the or API with an optional parameter element
which can be used to attach a custom HTML element instead of the default element selector.