If you are using a subscription key, call the Azure Maps REST API's directly for the few queries you need. The main benefit of the client libraries is support for more advanced auth methods like Microsoft Entra (Active directory). The responses from the latest Azure Maps REST API's are in GeoJSON format which is the native format that the Azure Maps Web SDK supports. The main purpose of the older search module was to convert the response from the older services into an easy format for the map to understand, but this is no longer required. Here is a really simple example:
var AZURE_MAPS_KEY = 'Your Azure Maps Key';
async function geocode(query){
var r = await fetch(`https://atlas.microsoft.com/geocode?api-version=2025-01-01&query=${query}&subscription-key=${AZURE_MAPS_KEY}`);
return r.json();
}
Running this code in the browser console as a test (with a real key) using the following code returns a GeoJSON Feature collection of results. In the Web SDK, you can add this directly into a data source and display the results on the map if you wanted.
geocode('New York').then(r => console.log(r))