Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jop-software/astro-cookieconsent
Simple to use Cookie Consent for Astro
https://github.com/jop-software/astro-cookieconsent
astro astro-integration cookie cookie-consent gdpr hacktoberfest
Last synced: 4 days ago
JSON representation
Simple to use Cookie Consent for Astro
- Host: GitHub
- URL: https://github.com/jop-software/astro-cookieconsent
- Owner: jop-software
- License: gpl-3.0
- Created: 2023-05-29T21:23:08.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-24T20:55:32.000Z (3 months ago)
- Last Synced: 2025-01-19T11:12:33.289Z (12 days ago)
- Topics: astro, astro-integration, cookie, cookie-consent, gdpr, hacktoberfest
- Language: TypeScript
- Homepage:
- Size: 49.8 KB
- Stars: 58
- Watchers: 2
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
vanilla-cookieconsent + Astro Integration
> Use [vanilla-cookieconsent](https://github.com/orestbida/cookieconsent) natively in Astro 🍪
## Installation
### Installation using the Astro CLI
Using the Astro CLI is the [recommended way](https://docs.astro.build/en/guides/integrations-guide/#automatic-integration-setup) to setup integrations in Astro.
```console
# 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.
```console
# 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`](https://www.npmjs.com/package/vanilla-cookieconsent) package.
## Usage
> [!NOTE]
> This is an example configuration, passing JavaScript callbacks here is currently not supported.```javascript
// astro.config.mjsimport 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](https://github.com/orestbida/cookieconsent) package.
Check their [Readme](https://github.com/orestbida/cookieconsent/blob/master/Readme.md) for more information and documentation.## Versions
| Version | State | `vanilla-cookieconsent` Version |
| --- | --- | --- |
| `3.x` | ![Unsupported](https://img.shields.io/badge/active_support-green?style=for-the-badge) | `3.x` |
| `2.x` | ![Unsupported](https://img.shields.io/badge/security_and_enterprise-orange?style=for-the-badge) | `2.x` |
| `1.x` | ![Unsupported](https://img.shields.io/badge/unsupported-red?style=for-the-badge) | `2.x` |## Professional support
Professional support is available. Please contact [[email protected]](mailto:[email protected]) for more information.
© 2023, jop-software Inh. Johannes Przymusinski