npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@capawesome/capacitor-vapi

v5.0.0-dev.25c9a34.1728154031

Published

Unofficial Capacitor plugin for Vapi SDK.

Downloads

5

Readme

@capawesome/capacitor-vapi

Unofficial Capacitor plugin for Vapi.[^1]

Installation

npm install @capawesome/capacitor-vapi @vapi-ai/web openai
npx cap sync

Android

Variables

This plugin will use the following project variables (defined in your app’s variables.gradle file):

  • $androidxCoreKtxVersion version of androidx.core:core-ktx (default: 1.13.1)

iOS

Add the NSMicrophoneUsageDescription, NSCameraUsageDescription and UIBackgroundModes keys to the Info.plist file (usually ios/App/App/Info.plist), which tells the user why your app needs access to the microphone and camera, and that it needs to run in the background:

<key>NSMicrophoneUsageDescription</key>
<string>The app needs access to the microphone to record audio.</string>
<key>NSCameraUsageDescription</key>
<string>The app needs access to the camera to record video.</string>
<key>UIBackgroundModes</key>
<array>
  <string>voip</string>
  <string>audio</string>
</array>

Configuration

No configuration required for this plugin.

Usage

import { Vapi } from '@capawesome/capacitor-vapi';

const echo = async () => {
  await Vapi.echo();
};

API

isMuted()

isMuted() => Promise<IsMutedResult>

Returns: Promise<IsMutedResult>


say(...)

say(options: SayOptions) => Promise<void>

| Param | Type | | ------------- | ------------------------------------------------- | | options | SayOptions |


setMuted(...)

setMuted(options: SetMutedOptions) => Promise<void>

| Param | Type | | ------------- | ----------------------------------------------------------- | | options | SetMutedOptions |


setup(...)

setup(options: SetupOptions) => Promise<void>

| Param | Type | | ------------- | ----------------------------------------------------- | | options | SetupOptions |


start(...)

start(options: StartOptions) => Promise<void>

| Param | Type | | ------------- | ----------------------------------------------------- | | options | StartOptions |


stop()

stop() => Promise<void>

addListener('callEnd', ...)

addListener(eventName: 'callEnd', listenerFunc: CallEndEventListener) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | --------------------------------------------------------------------- | | eventName | 'callEnd' | | listenerFunc | CallEndEventListener |

Returns: Promise<PluginListenerHandle>


addListener('callStart', ...)

addListener(eventName: 'callStart', listenerFunc: CallStartEventListener) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | ------------------------------------------------------------------------- | | eventName | 'callStart' | | listenerFunc | CallStartEventListener |

Returns: Promise<PluginListenerHandle>


addListener('conversationUpdate', ...)

addListener(eventName: 'conversationUpdate', listenerFunc: ConversationUpdateEventListener) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | ------------------------------------------------------------------------------------------- | | eventName | 'conversationUpdate' | | listenerFunc | ConversationUpdateEventListener |

Returns: Promise<PluginListenerHandle>


addListener('error', ...)

addListener(eventName: 'error', listenerFunc: ErrorEventListener) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | ----------------------------------------------------------------- | | eventName | 'error' | | listenerFunc | ErrorEventListener |

Returns: Promise<PluginListenerHandle>


addListener('speechUpdate', ...)

addListener(eventName: 'speechUpdate', listenerFunc: SpeechUpdateEventListener) => Promise<PluginListenerHandle>

| Param | Type | | ------------------ | ------------------------------------------------------------------------------- | | eventName | 'speechUpdate' | | listenerFunc | SpeechUpdateEventListener |

Returns: Promise<PluginListenerHandle>


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners for this plugin.


Interfaces

IsMutedResult

| Prop | Type | | ----------- | -------------------- | | muted | boolean |

SayOptions

| Prop | Type | Description | | ------------------------ | -------------------- | ---------------------- | | message | string | | | endCallAfterSpoken | boolean | Only available on Web. |

SetMutedOptions

| Prop | Type | | ----------- | -------------------- | | muted | boolean |

SetupOptions

| Prop | Type | | ------------ | ------------------- | | apiKey | string |

StartOptions

| Prop | Type | | ----------------- | ------------------- | | assistantId | string |

PluginListenerHandle

| Prop | Type | | ------------ | ----------------------------------------- | | remove | () => Promise<void> |

ConversationUpdateEvent

| Prop | Type | | -------------- | ---------------------------------------------------------------------------- | | messages | { content: string; role: 'user' | 'assistant' | 'system'; }[] |

ErrorEvent

Events providing information related to errors in scripts or in files.

| Prop | Type | | -------------- | ------------------- | | colno | number | | error | any | | filename | string | | lineno | number | | message | string |

SpeechUpdateEvent

| Prop | Type | Description | | ------------ | ----------------------------------- | ---------------------------------- | | role | 'user' | 'assistant' | Only available on Android and iOS. | | status | 'stopped' | 'started' | |

Type Aliases

CallEndEventListener

(): void

CallStartEventListener

(): void

ConversationUpdateEventListener

(event: ConversationUpdateEvent): void

ErrorEventListener

(error: ErrorEvent): void

SpeechUpdateEventListener

(event: SpeechUpdateEvent): void

Changelog

See CHANGELOG.md.

License

See LICENSE.

[^1]: This project is not affiliated with, endorsed by, sponsored by, or approved by Superpowered Labs Inc. or any of their affiliates or subsidiaries.