algoliasearch-client-javascript
algoliasearch-client-javascript copied to clipboard
Deno Support
Are there any plans for supporting Deno runtime?
It's already possible to import algoliasearch via esm.sh and skypack, however it seems that using XMLHttpRequest makes it impossible.
Thanks!
We have not had any requests in the past for Deno support, so have not yet looked into any quick wins. There's a couple options I see:
- polyfill XHR: https://deno.land/x/[email protected]
- pass a custom requester when creating the algoliasearch client, which uses fetch
I'd love to hear when you try these options out
Thank you for your quick response! Maybe the second option is better but the first one worked!
import algoliasearch from 'https://esm.sh/[email protected]';
import "https://deno.land/x/[email protected]/mod.ts";
const client = algoliasearch(APP_ID, API_KEY);
const index = client.initIndex('my_index');
index.saveObject(object);