UNPKG

gogo-ai-site-search

Version:

A plugin for Angular and Vue that integrates GOGO Get AI Site Search.

115 lines (77 loc) 2.42 kB
# GOGO GET AI Site Search Plugin A plugin for Angular and Vue that integrates GOGO GET AI Site Search into your application. ## Table of Contents - [Installation](#installation) - [Usage](#usage) - [Angular](#angular) - [Vue](#vue) - [API](#api) - [Example](#example) - [License](#license) - [Support](#support) ## Installation Install the plugin via npm or Yarn: ### npm ```bash npm install gogo-ai-site-search ``` ### Yarn ```bash yarn add gogo-ai-site-search ``` ## Usage ### Angular Import and use the plugin in your component or main module: ```typescript import { Component, OnInit } from '@angular/core'; import GOGOAISearchPlugin from 'gogo-ai-site-search'; @Component({ selector: 'app-root', templateUrl: './app.component.html', }) export class AppComponent implements OnInit { ngOnInit() { GOGOAISearchPlugin('your-api-key'); } } ``` ### Vue Import and use the plugin in your Vue component: ```vue <template> <div id="app"> <!-- Your app content --> </div> </template> <script> import GOGOAISearchPlugin from 'gogo-ai-site-search'; export default { name: 'App', mounted() { GOGOAISearchPlugin('your-api-key'); }, }; </script> ``` ## API ### `GOGOAISearchPlugin(apiKey)` Initializes the GOGO GET AI Site Search plugin. #### Parameters - **`apiKey`** `(string, required)`: Your GOGO GET AI Site Search API key. #### Description - The `GOGOAISearchPlugin` function injects the necessary elements into your application to enable GOGO GET AI Site Search. - It creates a `div` element with the `id` of `"root"` and sets a `data-api-key` attribute with your provided API key. - It appends a script tag to load the GOGO GET AI Site Search script from `https://gogostorage.blob.core.windows.net/search-plugin-snippet/main.js`. ## Example ```javascript // For both Angular and Vue import GOGOAISearchPlugin from 'gogo-ai-site-search'; // Initialize the plugin with your API key GOGOAISearchPlugin('your-api-key'); ``` **Note:** Replace `'your-api-key'` with the actual API key provided to you by GOGO AI Site Search. To get an API key, please visit [https://gogoget.ai/](https://gogoget.ai/), sign up, subscribe, scan your site, build a search plugin, and then retrieve the plugin key. ## License MIT License © [GOGOKC](mailto:support@gogokc.com) ## Support For any questions or issues, please contact [support@gogokc.com](mailto:support@gogokc.com).