# Integrations
Source: https://docs.nfig.io/Integrations
Nfig uses integrations to connect with your favorite tools
## Authentication
Nfig automatically detects login pages and asks you whether to use an integration to stay logged in, or to handle the login manually.
**Note**: This popup will only appear when a login page is detected.
Click on the toggle to initiate the login process.
### Login process
A browser plugin is required if you want the agents to stay signed in to the websites in your workflow. You'll be automatically prompted to install it once Nfig detects a login page, or you can install it from [here](https://chromewebstore.google.com/detail/nfig/okbfobojpclgmdllihgckbgiofaidgmf)
**Note**: If you don't install the browser plugin, you'll have to manually sign in to the websites in your workflow.
Nfig supports authentication via Linkedin, Amazon, Github etc. You can view the list and enable/disable them in [settings](https://app.nfig.ai/settings).
**Note**: Running multiple authenticated automations on target websites will increase the risk of your accounts being flagged as bots.
# Get workflow session status
Source: https://docs.nfig.io/api-reference/workflow-apis/get-workflow-session-status
api-reference/openapi-spec.json get /apis/request/workflow/status/{id}
# Run a workflow using workflow id
Source: https://docs.nfig.io/api-reference/workflow-apis/run-a-workflow-using-workflow-id
api-reference/openapi-spec.json post /apis/request/workflow/run
# Stop a workflow session
Source: https://docs.nfig.io/api-reference/workflow-apis/stop-a-workflow-session
api-reference/openapi-spec.json post /apis/request/workflow/stop/{id}
# Create a step workflow session
Source: https://docs.nfig.io/api-reference/workflow-step-mode-apis/create-a-step-workflow-session
api-reference/openapi-spec.json post /apis/request/workflow/step/create
# End a workflow session run
Source: https://docs.nfig.io/api-reference/workflow-step-mode-apis/end-a-workflow-session-run
api-reference/openapi-spec.json post /apis/request/workflow/step/stop/{id}
# Execute an individual step
Source: https://docs.nfig.io/api-reference/workflow-step-mode-apis/execute-an-individual-step
api-reference/openapi-spec.json post /apis/request/workflow/step/run/{id}
# Export a workflow session video
Source: https://docs.nfig.io/api-reference/workflow-step-mode-apis/export-a-workflow-session-video
api-reference/openapi-spec.json post /apis/request/workflow/video/url/{id}
# Get completion status of individual step
Source: https://docs.nfig.io/api-reference/workflow-step-mode-apis/get-completion-status-of-individual-step
api-reference/openapi-spec.json get /apis/request/workflow/step/status/{stepId}
# Introduction
Source: https://docs.nfig.io/introduction
API for AI Agents to Act on the Web
## Quickstart
Get your docs set up locally for easy development
Preview your changes before you push to make sure they're perfect
The Nfig SDK, integrated with the Nfig AI platform, offers a powerful toolset for browser automation. It enables you to control browser remotely, handle complex scenarios, and effortlessly adapt to changes on websites.
Tailored for rapid Node.js development, the SDK provides features and utilities to streamline your workflow. By connecting directly to the Nfig Engine, you can execute browser actions seamlessly. Leveraging Playwright as its automation library, the Nfig SDK currently supports only Node.js.
### Key Features
* **Remote Execution:** Automate actions either on a server/browser.
* **Data Extraction:** Read information from web pages, regardless of their structure, and process the data as needed.
* **Fallback Mechanism:** Automatic fallback to handle errors if a website’s structure changes unexpectedly.
### Typical Automation Use Cases
* Automated form submissions
* Data extraction and web scraping
# Platform Overview
Source: https://docs.nfig.io/platformoverview
Use Nfig playground to create AI Agents to Act on the Web
The Nfig AI platform offers a powerful toolset for browser automation. It enables you to control browser remotely, handle complex scenarios, and effortlessly adapt to changes on websites. Providing features and utilities to streamline your workflow, it connects directly to the Nfig Engine, allowing you to execute browser actions seamlessly. Leveraging Playwright as its automation library, it ensures efficient and reliable automation capabilities.
### Key Features
* **Build web automations:** Create and manage your browser automation workflows.
* **Authentication:** Incorporate authentication mechanisms to securely access websites in your workflows.
* **Automation modes:** Advanced mode enables you to build automations without the need of specifying each of the steps in a workflow\.. If you need more granular control, you could use the light mode.
### Typical Automation Use Cases
# Playground
Source: https://docs.nfig.io/playground
Nfig Playground is where you create, test, and debug your workflows.
### Nfig modes
Nfig offers two modes of workflow creation:
* **Autonomous mode:** This mode allows you to build workflows without the need of specifying each of the steps in a workflow.
* **Light mode:** This mode allows you to build workflows by specifying each of the steps in a workflow. Providing you granular control over the workflows.
### Workflow Creation Interface
The workflow creation interface allows you to build, test, and debug web automation workflows efficiently. It provides a comprehensive environment where you can set up each step of your automation and view real-time feedback.
#### 1. **Workflow Steps Panel (Left Side)**
* This area is where you define the sequence of actions for your automation. Each action or step in the workflow is represented by a box containing a short description of the task. You can add, remove, or modify these steps as required.
* Each step has a **Play** button on the left, allowing you to run individual steps in isolation. This is useful for testing specific parts of your workflow without executing the entire sequence.
* For full execution, you can select **Run All** at the top, which will simulate the entire workflow in sequence.
#### 2. **Live Preview (Right Side)**
* The right side of the interface displays a **Live Preview** of your automation. During execution, this panel shows a real-time view of the web interactions taking place, allowing you to observe how each step is performed on the website.
* The live preview provides visual feedback, helping you verify that each action in your workflow behaves as expected.
#### 3. **Activity Log (Bottom Left)**
* Below the workflow steps, the **Activity Log** captures a detailed record of actions and events during the workflow execution. Each log entry provides information about the status and output of each step, such as whether it completed successfully or encountered an error.
* This log is especially useful for troubleshooting and understanding the behavior of your automation. For instance, it may log interactions like “Memorizing the information,” “Scrolling down to capture content,” or “Sending email.”
#### 4. **Execution Summary**
* Once the workflow is completed, a summary message appears confirming a successful run. It provides options to rerun the workflow if needed or save it for future use. This summary ensures you know the outcome of the automation and allows you to repeat or modify the workflow as required.
#### 5. **Controls**
* The interface includes additional controls at the bottom for **Authentication** and **Proxy Status**, allowing you to adjust these settings based on your automation needs.
#### Usage Tips
* Use the **Run All** button to execute the entire workflow and test it end-to-end.
* For more granular testing, run individual steps using the play button next to each one.
* Monitor the **Live Preview** to ensure that each step is interacting with the website as intended.
* Refer to the **Activity Log** for detailed insights into each action, especially when troubleshooting.
# Proxy
Source: https://docs.nfig.io/proxy
Nfig uses proxying to mimic the network behavior of human users and avoid account flagging.
Nfig uses geo-location based proxies to achieve persistent anonymity, reliable and consistent authentication across different websites etc.
Proxies could be disabled using the toggle on the bottom right corner of the screen if required.
Note that this will generally decrease the reliability of your automations, as unproxied traffic could trigger bot detection. Nfig suggests using proxies for most of your workflows, and disable it only if the target website does not require it.
# Quickstart
Source: https://docs.nfig.io/quickstart
Start building intelligent, self-healing automations right away
## Generate API Key
Sign up on our [developer console](https://app.nfig.ai) and create a new [API key](https://app.nfig.ai/settings)
## Installation
**Prerequisite**: Please install Node.js (version 20 or higher) before proceeding.
```bash bash theme={null}
npm install --save nfig-sdk
# or
yarn add nfig-sdk
```
## Send your first request
```javascript javascript theme={null}
import { NfigClient } from 'nfig-sdk';
(async ()=>{
const nfig = new NfigClient({
apiKey: "YOUR_API_KEY",
});
await nfig.createSession()
const response = await nfig.act("Go to google.com")
}())
```
Please find the Nfig SDK [NPM Package](https://www.npmjs.com/package/nfig-sdk) here.
# null
Source: https://docs.nfig.io/releasenote/December_2024
**Release Notes: Nfig Version 1.1.0**
We’re excited to announce the latest release of Nfig, bringing new features, enhancements, and performance improvements to supercharge your browser automation experience. This release introduces powerful capabilities for both platform and SDK.
***
### 🚀 **New Features & Enhancements**
#### 1. **Enhanced Scraping Capabilities**
* **Full Page & Viewport Scraping via on Ask method in SDK**: You can now choose between scraping the entire page or just the visible viewport using the **SDK-Ask method**. This provides greater flexibility for capturing only what's needed, saving resources and boosting efficiency.
#### 2. **Session details and video export**
* **Session Details**: Get a comprehensive view of your session's details
* **Video Export of Session Runs**: Export and share videos of session runs effortlessly. Generate a shareable link to provide access to stakeholders or collaborators.
#### 3. **Workflow Management**
* **Draft Workflow Persistence**: When you run a single step using the **Play** button, Nfig will automatically save that step as part of a draft workflow. The workflow will be available after a refresh, ensuring your work is never lost.
* **Clear All Steps**: Added a **Clear All Steps** button to quickly delete all steps in your workflow with a single click, improving user productivity and workflow management.
#### 4. **Authentication & Proxy Support**
* **Authentication support in SDK**: The authentication process is now being rolled out, ensuring smoother access controls. Full documentation and testing are on the way.
* **Proxy usage in SDK**: Updated proxy usage documentation to simplify the configuration of proxies for your automated sessions. Testing is ongoing, but early access is available.
#### 5. **Chat support**
* **Chat directly with a support team member**:For improved support and faster communication with the Nfig support team, we've implemented a chat functionality where users could find support.
***
### 🛠️ **Improvements & Fixes**
* **Trial Credits Display**: When users make payments, trial credits are now properly reflected and displayed on the front end. This ensures clarity and transparency about credit usage and availability.
***
This update marks a significant leap in Nfig’s evolution, delivering new functionality, smoother workflows, and enhanced user experience. Start exploring these features and enhancements today, and let us know what you think!
**Need help or have feedback?**\
Contact our support team via **Chat support** or reach out to us at [support@nfig.ai](mailto:support@nfig.ai)).
# null
Source: https://docs.nfig.io/releasenote/November_2024
**Release Notes: Nfig 1.0.0**
Welcome to Nfig – Empowering AI Agents for Seamless Web Interactions!
We’re thrilled to announce the first release of **Nfig**, a purpose-built browser automation stack designed to revolutionize web interactions for action-oriented AI agents. Here’s what Nfig brings to the table:
### Key Features:
1. **Natural Language Integration**: Teach and instruct your AI agents with simple natural language commands, eliminating the need for complex scripts.
2. **Dynamic Adaptability**: Seamlessly adapt to changes in website structures, ensuring reliable automation that doesn't break with updates.
3. **Intelligent Automation**: Automatically optimize timings and interactions for consistent, maintenance-free performance.
4. **Effortless Setup**: Quick integration with your existing stack using our APIs or SDKs, accelerating your deployment timeline.
5. **Performance-Driven Design**: Lightweight and efficient, Nfig is engineered for high-speed, scalable, and dependable web interactions.
6. **Cloud-Ready**: Hassle-free deployment on modern cloud platforms, reducing infrastructure complexity and cost.
### Why Choose Nfig?
* Solve the **automation bottleneck** with a system built for **action-oriented AI agents**, surpassing traditional, brittle browser automation tools.
* Enable AI agents to execute real-world tasks such as data scraping, form filling, and process automation without manual intervention.
* Empower developers and businesses with a tool that combines control and abstraction, saving time and resources.
### What’s Next?
We’re just getting started! Future updates will focus on expanding AI agent capabilities, enhancing adaptive intelligence, and providing even deeper integration options.
**Try it today!** Explore Nfig’s power and see how it transforms your automation workflows. Visit [nfig.ai](https://nfig.ai) to get started.
Let’s redefine browser automation together. 🚀
# Samples
Source: https://docs.nfig.io/samples
Learn how to start building your intelligent automation using our sample scripts
#### Example -
```javascript javascript theme={null}
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);
}
})();
```
# SDK Reference
Source: https://docs.nfig.io/sdkreference-local
Dive deeper into the Nfig SDK capabilities
## Initialization
To initialize the SDK,create an instance of **NfigClient** with your API key. This connects your application to Nfig and allows interaction with the platform. During initialization, you can also specify the preferred browser mode **(LOCAL or REMOTE)** and enable debug mode to assist with troubleshooting.
```javascript javascript theme={null}
import { NfigClient } from 'nfig-sdk';
const nfig = new NfigClient({
apiKey: "YOUR_API_KEY",
browserMode: "REMOTE",
debug: true
});
```
| **Parameter** | **Type** | **Description** |
| ------------- | ------------------- | --------------------------------------------------------------- |
| `apiKey` | string | ***required***. Your API key from the Nfig Portal. |
| `browserMode` | "LOCAL" \| "REMOTE" | ***optional***. Specifies the browser mode. Defaults to REMOTE. |
| `debug` | boolean | ***optional***. Enables debug logging if set to true. |
## Session Management
**Note**: A managed session in Nfig is active for 5 minutes in remote mode.
```javascript javascript theme={null}
(async () => {
const nfig = new NfigClient({
browserMode: "REMOTE",
debug: true
});
const { previewUrl } = await nfig.createSession()
try {
await nfig.act('Go to google.com')
} catch (error) {
await nfig.endSession()
}
}())
```
## Creating a session
Use the ***createSession*** method to initialize a session.
**REMOTE Mode**: Automate actions in a remote browser environment.Returns a preview URL for live monitoring.
**LOCAL Mode**: Automate actions in a locally installed browser instance. Only supports Playwright for now\.Allows passing the Page context initially, making it available throughout the session, or you can pass it with each method call.
### Usage Example: REMOTE Mode
```javascript javascript theme={null}
(async () => {
const nfig = new NfigClient({ apiKey: "YOUR_API_KEY", browserMode: "REMOTE", });
const session = await nfig.createSession();
console.log(session.previewUrl);
})();
```
### Usage Example: LOCAL Mode
```javascript javascript theme={null}
import { chromium } from 'playwright';
(async () => {
const browser = await chromium.launch({ headless: false });
const page = await browser.newPage();
const nfig = new NfigClient({ apiKey: "YOUR_API_KEY", browserMode: "LOCAL", });
const session = await nfig.createSession({ currentPage:page });
})();
```
### Create Session Options
| **Parameter** | **Type** | **Description** |
| ------------- | ----------- | ------------------------------------------------------------------------------------------ |
| `currentPage` | Page | ***optional*** (LOCAL mode only). The Playwright Page instance to be used for the session. |
| `proxy` | boolean | ***optional*** (REMOTE mode only). Enables proxy while creating session. |
| `authOptions` | AuthOptions | ***optional*** (REMOTE mode only). Enabled authentication while creating a session. |
#### Auth Options in CreateSession
The AuthOptions provides configuration for authentication-related settings when creating a session using the createSession method.
It allows specifying the authentication app and other parameters for customizing authentication behavior.
The AuthOptions includes the following fields:
| Parameter | Type | Description |
| --------- | ---- | ---------------------------------------------------------------------------------------------- |
| `authApp` | enum | The authentication app is to be used during the session. Must be one of the allowed auth apps. |
#### Supported Authentications and Enums
The following table lists the standard integrations that are currently supported:
| Name | authApp field enum | 🚧 |
| ----------- | ------------------ | --------------- |
| Amazon | amazon | |
| Delta | delta | |
| DoorDash | doordash | |
| Facebook | facebook | |
| Github | github | |
| Instacart | instacart | |
| Instagram | instagram | |
| LinkedIn | linkedin | |
| Nextdoor | nextdoor | 🧪 experimental |
| OpenTable | opentable | |
| Twitter / X | twitter | |
| Resy | resy | |
| Uber | uber | |
| UberEats | uber\_eats | 🧪 experimental |
| United | united\_airlines | |
### Usage Example: REMOTE Mode with authentication and proxy
```javascript javascript theme={null}
import { chromium } from 'playwright';
import NfigClient from 'nfig-sdk';
(async () => {
const session = await nfig.createSession({
proxy:true,
authOptions:{
authApp:'linkedin'
}
});
console.log(session.previewUrl);
})();
```
## Ending a Session
```javascript javascript theme={null}
await nfig.endSession();
```
### EndSessionResponse
| **Field** | **Type** | **Description** |
| --------- | -------- | ---------------------------------------------------- |
| `success` | boolean | Indicates if the session was ended successfully. |
| `message` | string | Informational message about the session termination. |
**Note**: Ending a session is a necessary action to avoid unexpected billing.
## Exporting Session Video
```javascript javascript theme={null}
await nfig.exportVideo(sessionToken: string);
```
### ExportVideoResponse
| **Field** | **Type** | **Description** |
| --------- | -------- | ------------------------------------------------ |
| `success` | boolean | Indicates if the session was ended successfully. |
**Note**: You will an email with the link to exported video.
## Prompting
LOCAL mode can only take 1 precious action at a time.
Below is an example showing an Airbnb workflow using both modes.
### Usage example: LOCAL mode
```javascript javascript theme={null}
await nfig.act("Go to airbnb");
await nfig.act("search the location as himachal pradesh");
await nfig.act("select the location as himachal pradesh");
await nfig.act('click on the check in date');
await nfig.act('choose the date as december 15 2024')
await nfig.act('click on the checkout')
await nfig.act('choose the checkout date as december 20 2024')
await nfig.act('click on the guests')
await nfig.act('Set number of adults as 2')
await nfig.act('click on the search button')
```
### Usage example: REMOTE mode
```javascript javascript theme={null}
await nfig.act("Go to airbnb");
await nfig.act("Set the location as Himachal Pradesh");
await nfig.act('Set check in date as December 15 2024')
await nfig.act('Set check out date as December 20 2024')
await nfig.act('Set number of adults as 2')
await nfig.act('click on the search button')
```
## SDK Methods
### Act method
***act*** method performs specific actions on a webpage.
#### Basic usage
```javascript javascript theme={null}
const response = await nfig.act("Go to google.com");
```
#### Fallback Method
In LOCAL mode, ***act*** supports fallback method to try an action manually and use agent as a fallback method.
```javascript javascript theme={null}
const response = await nfig.act("Click on login button", { action: "click", selector: "#login-button" });
```
#### Parameters
| **Parameter** | **Type** | **Description** |
| ------------- | -------- | ------------------------------------------------------------------ |
| goal | string | ***required***. A descriptive goal for the action to be performed. |
| options | Object | ***optional***. Additional options to customize the action. |
#### Options
| **Property** | **Type** | **Description** |
| ------------ | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| currentPage | Page(playwright) | ***optional*** (LOCAL mode only). The Playwright Page instance. |
| execute | boolean | ***optional***. If set to false, the action will not be executed locally. Defaults to true. |
| action | "click" \| "type" \| "navigate" \| "wait" | ***optional***. Action is supported only on LOCAL mode. If the perfoming action is failed, it will be switched to agent mode. |
| selector | string | ***optional*** (For click and type action only). CSS selector of the element to type into. |
| iterCount | number | ***optional*** (For click action only). Number of times to perform the click action. |
| inputText | string | ***optional*** (for type action only). CSS selector of the element to type into. |
| enter | boolean | ***optional*** (for type action only). If set to true, simulates pressing the Enter key after typing. |
| url | string | ***optional***. URL to navigate to. |
| time | string | ***optional***. Time to wait in milliseconds. |
### Ask method
***ask*** method helps you retrieve information from a page in a structured way using Zod schemas.
```javascript javascript theme={null}
const response = await nfig.ask("Extract the pricing informations", {
schema: priceSchema,
pageMode: "fullPage"
});
```
#### Parameters
| **Parameter** | **Type** | **Description** |
| ------------- | -------- | ------------------------------------------------------------------ |
| goal | string | ***required***. A descriptive goal for the action to be performed. |
| options | Object | ***optional***. Additional options to customize the ask action. |
#### AskOptions
| **Property** | **Type** | **Description** |
| ------------ | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| currentPage | Page | ***optional*** (LOCAL mode only). The Playwright Page instance. |
| schema | ZodSchema | ***optional***. Zod schema to validate the extracted data against. |
| pageMode | "fullPage"
or
"viewPort" | ***optional*** (LOCAL mode only).
Choose between scraping the entire page or just the visible viewport. |
# Variables
Source: https://docs.nfig.io/variables
Nfig lets you use variables to store data between steps in a workflow
### Define variables
### Use variables