Drift in Hoplon.
https://www.drift.com/ http://hoplon.io/
Uses snippet version 0.3.1
from Drift installation docs.
hoplon-drift.data/id
can be set with :closure-defines
in the compiler
options for CLJS. This is optional as the id can be passed to the snippet at
runtime (see below).
A convenience fn hoplon-drift.compile/with-closure-defines
is provided.
with-closure-defines
accepts your existing config and an id directly, returns
the config with the id merged in.
The id is also supported as an environment variable as per environ
under
:drift-id
.
There is an example of this in build.boot
.
If you're using advanced compilation for cljs you will need to provide externs.
Current working externs for Drift can be found in externs.js
.
Simply call hoplon-drift.hoplon/snippet
with either your drift id or without
any arguments to fallback to the configured drift id (see above).
Interacting with the widget can be done through hoplon-drift.api.widget
fns.
Currently only show!
and hide!
are supported but extending this is pretty
easy and pull requests are welcome!
There is a demo widget hosted on github pages: