@coaktion/hc-lib
v0.1.9
Published
An typescript library to implement common function and utilities for Help Center development
Readme
@matheusdev20/hc-lib
Utility library for Zendesk Help Center development. Supports both v3 and v4 Help Center versions through a single factory method.
CDN Usage
Add the script tag to your Help Center template:
<script src="https://cdn.jsdelivr.net/npm/@matheusdev20/[email protected]/dist/index.global.js"></script> This exposes the global AktieHC object.
Instantiating
Call AktieHC.create() with the Help Center version:
<script>
// For Help Center v3
const hc = AktieHC.create("v3");
// For Help Center v4
const hc = AktieHC.create("v4");
// Bring API utilities like getArticles()
const hc = AktieHC.create("v4", ["articles"]);
</script>The returned hc object has the same interface regardless of version — the implementation details are handled internally.
Available Methods
const hc = AktieHC.create("v4", ["articles"]);
const { api } = hc
const { dom } = hc
const response = hc.articles.getAll(page = 4)
hc.setWithExpiry("localStorageKey", { value: "true"}, 60)Publishing a new version
Open a new Pull Request with your desirable changes to the main branch
After review and merge
Run
npm version patch
git push --follow-tagsDraft the release from the bumped tag and the gh action should take care of the rest
