Change the rotation of a plane on the surface of an object

Hello everyone I would like to change the rotation of a Geometry plane according to the surface of an object on the image below it is horizontal and I would like to put it vertical.
Capture d’écran 2023-01-03 à 15.02.04

I would like to know if anyone has examples of code for example of a plane that rotates around a sphere

I thank you in advance for your answer

You can change the rotation of a plane around z axis by 90 degrees like so:

const mesh = new THREE.Mesh(
  new THREE.PlaneGeometry(1, 1),
  new THREE.MeshBasicMaterial(),
);

mesh.rotation.z = Math.PI/2;

use rotation.x or rotation.y if you need to rotate around a different axis.