Skip to content

sup.intent

The sup.intent package provides intent return types that open native Sup flows with prefilled values.


Methods

sup.intent.emoji()

(opts: { image?: SupImage; name?: string; audio?: SupAudio }) → SupEmojiIntent

function main() {
const image = sup.ai.image.create('emoji of a star');
return sup.intent.emoji({ name: 'star', image });
}

Returns an intent to open the emoji creation flow with prefilled values.

At least one of image or audio is required. The user can edit the prefilled values before saving.

function main() {
const image = sup.ai.image.create(`emoji of ${sup.input.text || 'sparkles'}`);
const sound = sup.ai.tts('sparkle');
return sup.intent.emoji({
name: 'sparkles',
image,
audio: sound
});
}

Intent values should usually be returned directly from main() or another public function so Sup can open the corresponding native flow.