Common usage patterns

Show a prompt while the player is inside a zone

Call show once on entry and hide once on exit. Do not call show every frame.

client.lua

CreateThread(function()
    local promptVisible = false
    local location = vector3(-1037.0, -2737.0, 20.2)

    while true do
        local playerCoords = GetEntityCoords(PlayerPedId())
        local nearby = #(playerCoords - location) < 2.0

        if nearby and not promptVisible then
            exports.jex_interactions:show({
                id    = 'atm',
                key   = 'E',
                label = 'Use ATM',
            })
            promptVisible = true
        elseif not nearby and promptVisible then
            exports.jex_interactions:hide('atm')
            promptVisible = false
        end

        Wait(250)
    end
end)

Displaying a key does not handle the key press: the interaction logic stays in your own resource.

client.lua

if promptVisible and IsControlJustReleased(0, 38) then -- INPUT_CONTEXT / E
    TriggerEvent('my_resource:openMenu')
end

Several prioritised actions

client.lua

exports.jex_interactions:show({
    id       = 'primary_action',
    key      = 'E',
    label    = 'Open',
    priority = 100,
})

exports.jex_interactions:show({
    id       = 'secondary_action',
    key      = 'G',
    label    = 'Inspect',
    priority = 50,
})

If more prompts exist than Config.MaxVisible, the lower-priority ones wait until space becomes available.

Declaring the dependency in your manifest

Not required when the startup order is already guaranteed in server.cfg. If your resource must not start without the HUD, declare it:

fxmanifest.lua

dependency 'jex_interactions'

client_script 'client.lua'