import { NfigClient } from "nfig-sdk";
(async () => {
const nfig = new NfigClient({
apiKey: "API_KEY"
})
const session = await nfig.createSession();
try {
await nfig.act('go to amazon.com');
await nfig.act('click on search input box');
await nfig.act('type iPhone 16 Pro in search box');
await nfig.act('Press enter');
await nfig.endSession();
} catch (error) {
console.error('An error occurred:', error);
}
})();