UNPKG

@central-icons-react/round-outlined-radius-3-stroke-2

Version:

A collection of round outlined React icons with 3px radius and 2px stroke width, designed for use in React applications.

39 lines (30 loc) 918 B
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); const response = await fetch("https://centralicons.com/license/check", { method: "POST", headers: { Authorization: `Bearer ${licenseKey}`, }, 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"); } }; licenseCheck();