To install the Agastya script on your website, you need your API key. You can find this in your admin panel or by getting in touch with us over support. Once you have your API key, make sure that you have added your website in the list of trusted domains, otherwise Agastya will show an unauthorized error in your console.
API_KEY in the line below with your API key and add it before closing the
<script src="https://platform-beta.oswaldlabs.com/v1/agastya/load/API_KEY.js" async defer></script>
The above loader URL is currently in beta. When we're out of beta, you can safely replace
platform in the above line.
This loader script will automatically load the most recent, stable version of Agastya on your website, so your users always have the best features and security updates.
In the above table, "Migrated" means we've set up a script which loads the new loader instead of redirecting the endpoint. This is because the
Cache-Control headers of these loaders were set to infinite, and our internal update mechanism can load the most recent version of Agastya without changing the loader's code.
If you're using a package manager like NPM or Yarn, you can use the following package, but additional configuration is required. Our NPM package has no dependencies and creates a script to load the plugin.
We recommend using Yarn because it caches your packages. You can use the following line to install the
agastya package to your project.
yarn add agastya
Alternately, if you're using the NPM client, you can use the following line instead.
npm install agastya
You need to do additional configuration and initialize the package. Add the following code to your entry file (
If you're using ES6 imports and a bundler like Webpack, you can use the following line to import the package to your project.
import Agastya from "agastya";
Finally, initialize the plugin using the agastya.init function by supplying your API key as the parameter, and Agastya should be reading and working in your project.
const agastya = new Agastya("API_KEY");