Skip to content

Consider renaming injection keys to avoid collisions #6

@IsraelOrtuno

Description

@IsraelOrtuno

Hello! Thanks for the package, definitely useful for a quick installation in a Vue/Nuxt app. I found something that may be quite tricky to deal with and is the fact that the package uses Vue 3 provide to expose its api so it can be used anywhere. This is quite nice BUT the key names for these functions to be injected are too generic and are very likely to collision with other. I would suggest adding a prefix to those like tawk* (whatever other pattern may work too):

    const minimize = inject('tawkMinimize');
    const onLoad = inject('tawkOnLoad');
    const toggle = inject('tawkToggle');

Specially the ones mentioned in the example are way to generic and chances are that these names may already exist in an application. I am aware this may be a breaking change but will definitely help users to use the package and prevent unexpected behaviours so it could maybe be released in a v2 release.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions