> ## Documentation Index
> Fetch the complete documentation index at: https://jigsaw-13.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Getting started with JigsawStack Node.js SDK to build AI-powered applications

<Card title="Models" href="/docs/api-reference/authentication">
  Explore our complete list of models and API references here.
</Card>

## Prerequisites

Before you begin, make sure you have:

* Created a [JigsawStack account](https://jigsawstack.com/dashboard)
* Retrieved your [API key](https://jigsawstack.com/dashboard)
* Installed Node.js (version 18.10.0 or higher)

## Installation

Choose your preferred package manager to install the JigsawStack SDK:

<CodeGroup>
  ```bash npm theme={null}
  npm install jigsawstack
  ```

  ```bash yarn theme={null}
  yarn add jigsawstack
  ```

  ```bash pnpm theme={null}
  pnpm add jigsawstack
  ```

  ```bash bun theme={null}
  bun add jigsawstack
  ```
</CodeGroup>

## Configuration

There are two ways to configure your JigsawStack SDK:

### Option 1: Using environment variables (recommended)

Create a `.env` file in your project root:

```bash .env theme={null}
JIGSAWSTACK_API_KEY=your-api-key
```

### Option 2: Direct configuration

Initialize the SDK with your API key:

```javascript theme={null}
import { JigsawStack } from "jigsawstack";

const jigsawstack = JigsawStack({
  apiKey: "your-api-key",
});
```

## Quick Example

Here's how to use JigsawStack's AI Web Scraper to extract product information:

```javascript theme={null}
import { JigsawStack } from "jigsawstack";

// Initialize the SDK (API key from environment variables)
const jigsawstack = JigsawStack();

// Basic usage - extract pricing information
const result = await jigsawstack.web.ai_scrape({
  url: "https://supabase.com/pricing",
  element_prompts: ["Plan title", "Plan price"],
});
```

## Response Format

The AI scraper returns structured data based on your prompts:

```json theme={null}
{
  "page_position": 1,
  "page_position_length": 3,
  "context": {
    "Plan title": ["Free", "Pro", "Team", "Enterprise"],
    "Plan price": ["$0", "$25", "$599", "Custom"]
  },
  "selectors": {
    "Plan title": [
      "h3.text-foreground.text-2xl.font-normal.uppercase.flex.items-center.gap-4.font-mono"
    ],
    "Plan price": [
      "div.text-foreground.flex.items-baseline.text-5xl.font-normal.lg\\:text-4xl.xl\\:text-4xl.border-b.border-default.lg\\:min-h-\\[175px\\].py-8.lg\\:pb-0.lg\\:pt-10 p.mt-2.pb-1.font-mono.text-5xl",
      "div.text-foreground.flex.items-baseline.text-5xl.font-normal.lg\\:text-4xl.xl\\:text-4xl.border-b.border-default.lg\\:min-h-\\[175px\\].py-6.lg\\:pb-0.pt-6 p.mt-2.pb-1.font-mono.text-5xl",
      "div.text-foreground.flex.items-baseline.text-5xl.font-normal.lg\\:text-4xl.xl\\:text-4xl.border-b.border-default.lg\\:min-h-\\[175px\\].py-8.lg\\:pb-0.lg\\:pt-10 p.mt-2.pb-1.font-mono.text-4xl"
    ]
 },
 ...
}
```

## What's Next?

Now that you've set up JigsawStack, you can:

* Explore our [API reference](/docs/api-reference/authentication) for all available models
* Check out our [examples](https://jigsawstack.com/docs/examples/ai/vocr) for common use cases
* Join our [Discord](https://jigsawstack.com/discord) for support

Kuddos! You're ready to build powerful AI applications with JigsawStack.
