@iconly/api-client
v1.0.1
Published
Framework-agnostic Iconly REST API client
Downloads
42
Readme
@iconly/api-client
Framework-agnostic TypeScript client for the Iconly API.
Install
npm install @iconly/api-clientUsage
import { IconlyApiClient, withPremiumMessage } from "@iconly/api-client";
const client = new IconlyApiClient("iconly_sk_YOUR_KEY");
const profile = await client.getMe();
console.log(profile.is_subscribed);
const { icons } = await client.searchIcons({ q: "home", page_size: 10 });
const icon = withPremiumMessage(icons[0], "svg_url", "png_url");
if (icon.download_url) {
const svg = await client.fetchUrlContent(icon.download_url);
}API key
Create a key at Iconly Settings → Developer. Keys use the format iconly_sk_....
License
MIT
