cliqz-logo-database is a JavaScript library providing programmatic access to a curated, local database of company and brand logos. It enables developers to retrieve a logo's URL and primary color information based on a given website URL. Currently at version 0.7.0, it ships with TypeScript types, facilitating its integration into modern TypeScript projects. The library's primary differentiator is its ability to offer an offline-first lookup for logos, circumventing the need for external API calls for recognized brands. It supports both ESM and CommonJS import patterns, offering flexibility across various JavaScript environments. While stable at its current version, being pre-1.0 suggests the API might evolve in future major releases, although active development status beyond maintenance is not explicitly stated.
npm install cliqz-logo-databaseVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to import and use the `getLogo` function to fetch logo information for various URLs. It includes type safety for the `Logo` object and handles cases where no logo is found, logging the details to the console.
Always check the release notes before upgrading pre-1.0 versions. Pin exact versions in production environments.
Be aware of potential data staleness. For frequently changing or very new brand logos, an external, real-time API might be necessary.
Always check the return value of `getLogo` before accessing its properties, e.g., `if (logo) { /* use logo */ }`.Use `const getLogo = require('cliqz-logo-database').default;` for CommonJS environments.Import `getLogo` as a default export: `import getLogo from 'cliqz-logo-database';`
Implement a null check: `const logo = getLogo(url); if (logo) { console.log(logo.url); } else { console.log('No logo found.'); }`No dependency data recorded yet.