Dive deeper into the Nfig SDK capabilities
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 enable debug mode to assist with troubleshooting.
Parameter | Type | Description |
---|---|---|
apiKey | string | required. Your API key from the Nfig Portal. |
debug | boolean | optional. Enables debug logging if set to true. |
Note: A managed session in Nfig is active for 15 minutes.
Use the createSession method to initialize a session.
Use the endSession method to end a session.
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.
act method performs specific actions on a webpage.
Parameter | Type | Description |
---|---|---|
goal | string | required. A descriptive goal for the action to be performed. |
ask method helps you retrieve information from a page in a structured way using Zod schemas.
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. |
Property | Type | Description |
---|---|---|
schema | ZodSchema | optional. Zod schema to validate the extracted data against. |
Dive deeper into the Nfig SDK capabilities
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 enable debug mode to assist with troubleshooting.
Parameter | Type | Description |
---|---|---|
apiKey | string | required. Your API key from the Nfig Portal. |
debug | boolean | optional. Enables debug logging if set to true. |
Note: A managed session in Nfig is active for 15 minutes.
Use the createSession method to initialize a session.
Use the endSession method to end a session.
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.
act method performs specific actions on a webpage.
Parameter | Type | Description |
---|---|---|
goal | string | required. A descriptive goal for the action to be performed. |
ask method helps you retrieve information from a page in a structured way using Zod schemas.
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. |
Property | Type | Description |
---|---|---|
schema | ZodSchema | optional. Zod schema to validate the extracted data against. |