Prepare your extension and install the SDK into your browser extension.
alarms
storage
tabs
webNavigation
scripting
<all_urls>
- This is only necessary if you are developing a manifest v2 extension.permissions
array. Sleek runs CAA on every e-commerce page that the user interacts with. To do
so, Sleek requires the following host permissions:
@sleek/web-ext-coupon-sdk
package from Sleek’s private repo.
@sleek/web-ext-coupon-sdk
package. In addition, we recommend a setup where the
package repo URL is maintained by a .npmrc
file in the root of your project’s
directory.
@sleek/web-ext-coupon-sdk
in whatever fashion
best fits your needs. Use the private repo URL listed below and follow steps
for your package manager..npmrc
file in the root of your directory:
@sleek
scope (like our
@sleek/web-ext-coupon-sdk
) will be fetched from our private repo, when
installed and updated.
You should commit the resulting .npmrc
file, if you aren’t already, so that
your collaborators can use Sleek’s SDK as well.
_authToken
field above is secured like any other
secret key in your organization.fc.js
, f.js
, and t.js
.
The static scripts can be found in the downloaded web-extension-sdk package:
node_modules/@sleek/web-ext-coupon-sdk/dist/*
.
Copy the scripts into the root of your outputted and packaged web extension. We
recommend adding this step to your build pipeline. i.e. f.js
, fc.js
, and
t.js
should be in the root of your extension, at the same level as your
manifest.json
.
registerEventListener
:
registerEventListener
is typed, so if you are
calling with TypeScript, the event types are present in the package’s types and
the callback method will have data correctly typed as well. You can check
event
(seen above) against EventType
to see what
event was emitted.