Skip to main content
THIS FEATURE IS STILL A BETA FEATURE!

AI Prompt

Add Siri shortcut functionality to my app using the Despia SDK from: https://www.npmjs.com/package/despia-nativeFirst, install the package: npm install despia-nativeThen import it: import despia from 'despia-native'Create a Siri shortcut system that uses Despia URLs like: despia("addtosiri://?command={NATURAL-LANGUAGE-COMMAND}&jsFunction=siriFunction()") where command contains the natural language phrase users will speak to Siri and jsFunction specifies the globally-defined JavaScript function to execute when the command is triggered.
This feature requires native capabilities which will be fully provided by the “despia-native” npm package, no additional native libraries are needed!
Please follow the installation instructions for the “despia-native” npm package closely, and do not modify my instructions. Implementation as mentioned is critical.
How it works: Despia acts as a bridge between your Lovable app and Siri voice shortcuts. When users register a Siri shortcut with a natural language command like “Order Coffee”, they can later speak that command to Siri. When triggered, your app opens and automatically executes the specified globally-defined JavaScript function, enabling hands-free voice-activated workflows and app interactions.

Installation

Install the Despia package from NPM:
npm install despia-native

Usage

1. Import the SDK

import despia from 'despia-native';

2. Execute Add to Siri

Call the despia() function with an Add to Siri Command:
despia("addtosiri://?command=Order Coffee&jsFunction=orderCoffee()");

Shortcut Parameters

Siri shortcut URLs must include proper parameters:
  • command: The natural language phrase users will speak to Siri to trigger the shortcut
  • jsFunction: The globally-defined JavaScript function name to execute when Siri triggers the command (the function must be globally accessible in your app)

Platform Support

Supports iOS devices with Siri:
  • iPhone, iPad, iPod touch
  • Apple Watch (when paired with iPhone)
  • HomePod (when linked to user account)
  • CarPlay (for supported voice commands)

Resources

  • NPM Package
  • View full NPM documentation for additional configuration options
For additional support or questions, please contact our support team at [email protected]