@lordlingham/create-tealium-tool

1.0.2 • Public • Published

create-tealium-tool

create-tealium-tool allows for you to create template files for custom Tealium tools.

Usage

Install the tool globally using npm i -g @lordlingham/create-tealium-tool Navigate to your destination directory and then generate your starter files using create-tealium-tool

For example

npm i -g @lordlingham/create-tealium-tool mkdir my_tool && cd my_tool` create-tealium-tool

You will be prompted to answer a few basic questions about the tool, which will populate the template files.

The following files will be generated.

tool.json This file will contain your setup information about the tool, and generally does not need to be modified.

ui.html This will be a template file - You will want to edit this to provide a UI within the extension popup. We use Handlebars to generate the output when the tool is in use.

page.js This file will be the main star of the show. This will be the JavaScript which executes the functionality of the tool, and if required - pass messages back to the extension popup to be displayed within the template defined in ui.html This template file contains basic checks against the page the tool is being ran on for TIQ or CDH. Any other rules should be easy to change - You can modify or remove these checks if necessary.

Predefined functions

Function Description
main The main function that runs when the tool is messaged. Generally this contains a switch statement checking for a command property and acts accordingly.
log Used to send messages from the window to the extension
ui_state Helps control the UI State of the extension, use this to easily switch between views / stages of user interaction within the UI.
error Records / sends error message and updates the UI State
makeProgressCircle Updates the UI State to "ui_wait" which adds a CSS Spinner
makeFinishCircle Updates the UI state to "ui_finish" which removes the associated CSS Spinner

Further Reading

https://community.tealiumiq.com/t5/Technical-Solutions/Tealium-Tools-Framework/m-p/15688 https://community.tealiumiq.com/t5/Developer-Tools/Creating-Custom-Tealium-Tools/ta-p/332

Package Sidebar

Install

npm i @lordlingham/create-tealium-tool

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

14.7 kB

Total Files

8

Last publish

Collaborators

  • lordlingham