Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
1
2
3
4
5
6
7
8
import process from "node:process";
export const fetchGiphy = (async (searchTerm) => {
const { GiphyFetch } = await import("npm:@giphy/js-fetch-api");
const gf = new GiphyFetch(process.env.giphyApiKey);
const { data: gifs } = await gf.search(searchTerm, { limit: 10 });
return gifs;
});
October 23, 2023