JSPM

@jop-software/astro-cookieconsent

3.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 819
  • Score
    100M100P100Q124250F
  • License GPL-3.0-or-later

vanilla-cookieconsent for astro

Package Exports

  • @jop-software/astro-cookieconsent

Readme

vanilla-cookieconsent + Astro Integration

Use vanilla-cookieconsent natively in Astro 🍪

Installation

Installation using the Astro CLI

Using the Astro CLI is the recommended way to setup integrations in Astro.

# npm
npx astro add @jop-software/astro-cookieconsent

# pnpm
pnpm astro add @jop-software/astro-cookieconsent

Manual Installation

When the automatic setup from Astro is not an option for you, feel free to install the package manually.

# npm
npm install @jop-software/astro-cookieconsent

# pnpm
pnpm add @jop-software/astro-cookieconsent

Make sure that either your package manager installs peer dependencies or to manually install the vanilla-cookieconsent package.

Usage

[!NOTE]
This is an example configuration, passing JavaScript callbacks here is currently not supported.

// astro.config.mjs

import cookieconsent from "@jop-software/astro-cookieconsent";

export default defineConfig({
    // ...
    integrations: [
        // ...
        cookieconsent({
            // ...
            guiOptions: {
                consentModal: {
                    layout: 'cloud',
                    position: 'bottom center',
                    equalWeightButtons: true,
                    flipButtons: false,
                },
                preferencesModal: {
                    layout: "box",
                    position: "right",
                    equalWeightButtons: true,
                    flipButtons: false,
                },
            },
            // ...
        }),
    ],
});

When you call the integration, you can use the same configuration as you can in the vanilla-cookieconsent package. Check their Readme for more information and documentation.

Versions

Version State vanilla-cookieconsent Version
3.x Unsupported 3.x
2.x Unsupported 2.x
1.x Unsupported 2.x

Professional support

Professional support is available. Please contact support@jop-software.de for more information.