https://github.com/lucybot-inc/embed-sample
Learn how to embed LucyBot components in an existing website
https://github.com/lucybot-inc/embed-sample
Last synced: about 2 months ago
JSON representation
Learn how to embed LucyBot components in an existing website
- Host: GitHub
- URL: https://github.com/lucybot-inc/embed-sample
- Owner: LucyBot-Inc
- Created: 2017-06-02T14:29:22.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-05T18:48:47.000Z (almost 8 years ago)
- Last Synced: 2025-01-23T14:15:17.531Z (3 months ago)
- Language: TypeScript
- Size: 28.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LucyBot Embed Sample
Learn how to embed LucyBot components in an existing website> You must have an access key for LucyBot's Documentation Generator to use this demo.
## Setup
Most of this repository contains Angular 2 boilerplate, but there are two additional steps to get LucyBot
components into your Angular app:### OpenAPI
The OpenAPI definition is contained in `./openapi.json`.
It is loaded by setting `window.lucybot.openapi.default` in ./app/openapi.js.You can load multiple API definitions and switch between them by calling `OpenAPIService.retrieveSpec(specName)`.
### Angular Module
In ./app/app.module.ts, we import the LucyBot module so we can reference its components, directives, pipes, and services elsewhere.```typescript
import * as LucyBot from 'lucybot/app/embed.module';@NgModule({
imports: [
LucyBot.EmbedModule,
],
})
```## Usage
The main components are:
* `` - an API console component
* `` - A modal for entering API Keys or starting OAuth flows. You can also use `SecretsService` to programatically pass credentials to LucyBot.
* `` - displays parameters and responses for a given operation
* `` - displays JSON schema, as well as an example JSON object./app/components/home.ts contains the logic and HTML of this demo. It shows how to use each
of the above components, as well as the `OpenAPIService`.For example:
```html
```