How to set hdr texture as environment map?

I have this html code

<div id="babylonViewer">
   <babylon id="babylon-viewer">
        <model url='/static/lookdev.glb'></model>

How do I set a hdr texture for the lighting?

Searching on the internet and the documentaion I have tried code bellow, but nothing seems to change

    .then(function(viewer) {
      console.log('Viewer loaded')
      viewer.onSceneInitObservable.add(function(scene) {
          let tex = new BABYLON.HDRCubeTexture('/static/lighttext.hdr', scene, 128, false, true, false, true);
          return scene;

Never used viewer, but know you either need to assign the texture as the reflection texture of every material, or just to the scene like:

scene.environmentTexture = tex;

Doesnt make any difference.
Can you link me with an example to do it without a viewer? I just want to import gltf and set a custom hdr light.

You can search the playground for code. Click the question mark at bottom left. Got many hits for scene.environmentTexture. Here is one.