Async JavaScript Mode

For more examples, head over to my repo

In the async Javascript mode Sora will only provide the search keyword for the the searchResults function and the URL for the other three functions. Aside from that, the response format is required to be the same as normal mode.

WARNING:

Do not use .json() or .text() methods as those will not work on iOS!

For .json():

Wrong method
const data = await response.json();

Instead use:

Correct method
const data = await JSON.parse(response);

For .text():

Wrong method
const data = await response.text();

Instead assign the value directly:

Correct method
const data = await response;

Goes without saying that this applies to StreamAsync mode too. You shouldn't need these methods in normal mode but if you do, use the above mentioned way.

Functions:

Extracts the search results from the provided keyword.

Input
Output

Keyword

JSON

Output JSON format
{
   "title": "Example Title",
   "image": "https://example.com/image.jpg",
   "href": "https://grani.me/example"
}

Example:

Last updated