Page classification
Specific integration instructions to enable page classification.
Sleek’s SDK automatically classifies the pages your users are visiting. To setup this experience for your users, you’ll need to provide Sleek with the pages that you want to classify. This documentation will guide you through the integration process.
This document assumes that you have already integrated the Sleek SDK into your extension. If you haven’t, please refer to the SDK integration guide.
Enable page classification
After Sleek is installed and setup in your extension, you are ready to enable page classification.
Automatically classify pages
To automatically classify pages, set featureControls.emitPageClassification
to
true
in the SDK’s options during initialization.
Now that you have enabled page classification, Sleek will automatically classify
the pages your users are visiting. You can subscribe to the PAGE_CLASSIFIED
event to be notified when a page has been classified.
Register for page classification events
Sleek’s SDK automatically emits events when pages are classified. Subscribe to
the PAGE_CLASSIFIED
event to be notified when a page has been classified.
For example, you might want to show different UI based on what type of page the user is viewing. To do so, you can follow a pattern like:
Manually classify pages
In addition to automatic emission of page class, you can manually classify a
page by calling the classifyPageOnTab
method.
What’s next:
Now that you have enabled page classification in your extension, you can check out the TypeDoc for specific event types and methods on the SDK.
View TypeDoc
Browse the reference TypeDoc for the SDK.