API Usage

11 articles in this category

API Initialization

Agastya features a powerful API with a number of methods you can call. Note that the Agastya widget already makes use of these APIs and you don't need to use them unless you're building a custom accessibility widget. To use these methods, you...

AutoALT™

This API runs automatically if your webpage has images that do not have an ALT tag. It performs deep learning-based image recognition and automatically adds the relevant caption as an ALT tag and aria-label to the image. agastya.autoAlt(paramet...

Modes

Modes are predefined "themes" that consist of backgroud and text colors, typefaces, and font sizes. You can use the agastya.reset() method to reset the mode. You can also also add your own custom modes by logging into the Agastya dashboard. ...

Read Aloud

This feature uses the speechSynthesis API to read out the text on the webpage. This is useful for visually impaired users who do not have a screenreaders, or any other users who might want to listen to the content of your page rather than read i...

Reset

You can use this method to reset the design of a webpage after your user has changed it. agastya.reset(parameter); These parameters are allowed: Parameter Code Description (empty) agast...

Open Widget

As the name suggests, you can use this method to open the Agastya widget. If it is already open, there will be no effect to calling this method. When a user opens Agastya the first time, the widget stylesheet is loaded, followed by the widget op...

Close Widget

Similarly to the Open function, you can use this method to close the Agastya widget. If it is already closed, there will be no effect to calling this method. When a user closes Agastya, the widget is not removed from the DOM, it just fades out, ...

Toggle Widget

This method is the most efficient way to open and close the widget using just one button. It opens the widget if it is closed, and vice versa. agastya.toggle(); You can add this method to a button with a simple onclick event, for example...

Translate Webpage

This feature uses the Website Translator by Google to allow users to translate the content of your webpage to all supported languages. agastya.translate(parameter); The parameters allowed are present on Google's webpage (https://cloud.go...

Font Size

This method is used to change the font size of the webpage. Using this, users can increase the font size for a more comfortable reading experience. It is especially useful for audiences with slight visual impairment, like senior citizens. a...

Font Face

This method is used to change the typeface of the webpage. Using this, users can use Open Dyslexia, a serif or a sans-serif font based on their reading preference. It is especially useful for audiences with dyslexia or similar reading disorders ...