From 6f117eab656c525900530b7fcd78d74d644f9c60 Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Thu, 2 May 2024 23:50:01 +0200 Subject: [PATCH] :pencil: Update Javascript docs to mention NPM package --- docs/javascript.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/javascript.rst b/docs/javascript.rst index 1f83361..8afc063 100644 --- a/docs/javascript.rst +++ b/docs/javascript.rst @@ -105,8 +105,18 @@ The ``status_url`` is special - it points to a backend view which returns the user-specific cookie consent status, returning the appropriate accept and decline URLs and other details relevant to cookie consent. -You can of course also import this function in your own Javascript entrypoint (if you -use Babel/Webpack or similar tooling) and initialize the cookie bar that way. +.. note:: + + If you prefer the include the cookiebar module in your own Javascript entrypoint, + the easiest way is to install our `published package`_. + + This package should work with TypeScript, Webpack, ESBuild, Vite... and other popular + bundlers and toolchains. + + Just be careful to install the same (minor) version as the backend package to avoid + weird bugs. + +.. _published package: https://github.com/orgs/jazzband/packages?repo_name=django-cookie-consent Options =======