@leena-ai/nativescript-sdk
v1.1.5
Published
Add a plugin description
Readme
@leena-ai/nativescript-sdk
ns plugin add @leena-ai/nativescript-sdkUsage
XML + Typescript
Add
xmlnsto Page elementUse the name of
xmlnsas a selectorLeena SDK exports the component named
Sdkwhich can be used to open a Leena botExample:
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:ln="@leena-ai/sdk" navigatingTo="navigatingTo" class="page"> <!-- Here Goes your Header and any other UI --> <GridLayout> <ln:Sdk clientId="{{ clientId }}" token="changeme"></ln:Sdk> </GridLayout> </Page>
Nativescript Angular
- Import
NativeScriptSdkModulein the module you want to load Leena App - Leena SDK exports a component named
Sdkthat can used like any other Angular component - You can also provide a
pageTransitionif the sdk is opened as a new route with it's own component
home.component.html
<Button text="Leena AI" [nsRouterLink]="['/leena']" pageTransition="slideLeft" ></Button>leena.component.html
<GridLayout>
<Sdk clientId="clientId" token="changeme"></Sdk>
</GridLayout>Note: Use a <GridLayout> instead of <StackLayout> if the UI does not load
API
| Property | Default | Required | Description | | ----------------- | ------- | - |------------------------------------------------------ | | clientId | - | Yes |The client ID for Leena bot. | | token | - | Yes |The app token which will authenticate the user with Leena App |
License
Apache License Version 2.0
