UNPKG

@central-icons-react/square-filled-radius-0-stroke-1

Version:

A collection of square filled React icons with 0px radius and 1px stroke width, designed for use in React applications.

47 lines (38 loc) 1.15 kB
const licenseKey = process.env.CENTRAL_LICENSE_KEY; if (!licenseKey) { throw new Error( "Central Icons license key is not set. Please set CENTRAL_LICENSE_KEY in your environment", ); } const licenseCheck = async () => { const controller = new AbortController(); const timeoutId = setTimeout(() => controller.abort(), 5000); try { const response = await fetch("https://centralicons.com/license/check", { method: "POST", headers: { Authorization: `Bearer ${licenseKey}`, }, body: JSON.stringify({ package: "central-icons-react/square-filled-radius-0-stroke-1", version: "0.0.61", }), signal: controller.signal, }); clearTimeout(timeoutId); if (controller.signal.aborted || response.status >= 500) { // Server Error, handling in customer favour return; } const responseJson = await response.json(); if (responseJson.error) { throw new Error(responseJson.error); } if (!responseJson.data.isValid) { throw new Error("Invalid license key"); } } catch (error) { console.error(error); } }; licenseCheck();