Plain Javascript integration using <ai-term> VanillaJS Web Components
AI-Term Authentication Setup
You must setup your <ai-term>
auth key within your web site by adding a meta
tag to your <head>
section:
<head> <meta name="ai-term_ApiKey" content="##### API KEY ####"/> <!-- Your other head content goes here --> </head>
Installation
Simply include the library in your index HTML file. Add the following script tag as the first element inside the <body>
or <head>
tag:
<body> <script type="module" src="https://cryptng.github.io/ai-term-vanillajs/ai-term.js" crossorigin="anonymous"></script> <!-- Your body content goes here --> </body>
Usage of <ai-term>
Web Component
To use the <ai-term>
component, wrap the term you want to enhance within the <ai-term>
element. For example:
<h1 class="page-title"> The <ai-term>Privacy-Friendly</ai-term> Alternative for Secure, User-Respecting Web Human Verification </h1>
AI-Term chat box web component location and options
To add the AI-powered chat interface, include the <ai-term-chat>
element towards the end of your body content. Provide your API key and optional configuration options as attributes:
<!-- Your body content is here --> <ai-term-chat api-key="your_api_key" options="{chat:'no'}"></ai-term-chat> </body>
Configuration
api-key
: Your unique API key for accessing AI services. This overrides the meta tag api-key and can be used for the dev api key. Remember to remove before deploying you site to production.options
: A JSON object with configuration settings. For example,{"hightlight":"rgb"}
activates the rgb gradient underline for all ai-term tags. Check styling section for more information.
Examples
Here are some examples of how to use in your project:
- Basic Term Highlighting:
<ai-term>Edge Computing</ai-term>
- Chat Interface:
<ai-term-chat ></ai-term-chat>
Support
For support, issues, or contributions, please visit the GitHub repository.