Skip to content

Commit

Permalink
📝 Update Javascript docs to mention NPM package
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed May 2, 2024
1 parent 5aa52d0 commit 6f117ea
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions docs/javascript.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
=======
Expand Down

0 comments on commit 6f117ea

Please sign in to comment.