Skip to content
Console
Try one

    Client identities and protocols

    Create a client identity, load it back, and see which protocols it can use.

    Part of SDK Functions. Every call below is shown in each language that has it.

    Create an identity when a browser, service, voice client, device, or agent needs to connect to one hub.

    result = api.create_client_identity(
    "hub-id",
    name="checkout-kiosk",
    preferred_protocols=("wss", "https"),
    )
    identity = result.identity

    Every SDK also accepts an active option on creation, and it defaults to true. Pass false to provision the client disabled, so it cannot connect until you activate it with a client update.

    Use config or a downloaded identity file when the client already exists.

    On Linux and macOS, protect local config.yaml and _identity.json files with owner-only permissions before loading them:

    Terminal window
    chmod 600 ~/.config/thalovant/config.yaml
    chmod 600 _identity.json
    from thalovant import ThalovantClient, ThalovantIdentity
    identity = ThalovantIdentity.from_config(profile="prod")
    same_identity = ThalovantIdentity.from_file("_identity.json")
    client_from_config = ThalovantClient.from_config(profile="prod", protocol="wss")
    client_from_file = ThalovantClient.from_identity_file("_identity.json")
    client_from_env = ThalovantClient.from_env()

    Use protocol helpers before forcing WSS, HTTPS, or MQTT.

    print(identity.enabled_protocols())
    print(identity.endpoint_for("wss"))
    print(identity.endpoint_for("https"))
    print(identity.endpoint_for("mqtt"))
    print(identity.supports_protocol("wss"))
    if identity.mqtt:
    print(identity.mqtt.endpoint)