Files
4eb0da e59477edcc Fix audit errors
commit_hash:16c452a817109921410ca6ed977f3ba78a8b2dfb
2026-01-16 12:50:02 +03:00
..
2023-04-25 17:11:05 +03:00
2023-04-25 17:11:05 +03:00
2023-04-25 17:11:05 +03:00
2026-01-16 12:50:02 +03:00
2026-01-16 12:50:02 +03:00
2023-04-25 17:11:05 +03:00
2023-04-25 17:11:05 +03:00

Writing your own extension

General notes about extensions

More information about using extensions

Install the packages first:

npm ci

Then build:

npm run build

And then open dist/index.html file to see the result.

Extension class

All extensions are a class with a constructor and optional methods mountView and unmountView:

class MyExtension {
    constructor(params) {}

    mountView(node, context) {}

    unmountView(node, context) {}
}

Using mountView you can access the DOM node. The unmountView method is suitable for cleaning purposes if you need it.

Compatibility

Be sure to test your extenson on any DivKit update, even on a minor and patch versions.