> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nuabase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Start building type-safe LLM functions in minutes

In this guide, we will build a simple Node.js script that uses Nuabase to classify customer feedback.

## Prerequisites

* Node.js and npm installed.
* A [Nuabase account](https://console.nuabase.com).

## Step 1: Install the SDK

Install the `nuabase` package and `zod` for schema definition.

```bash theme={null}
npm install nuabase zod
```

## Step 2: Get your API Key

1. Log in to the [Nuabase Console](https://console.nuabase.com).
2. Navigate to **API Keys**.
3. Create a new key and copy it.

## Step 3: Write your first function

Create a file named `index.ts` (or `index.js`):

```typescript theme={null}
import { Nua } from 'nuabase';
import { z } from 'zod';

// Initialize with your API Key
const nua = new Nua({ apiKey: 'YOUR_NUABASE_API_KEY' });

// Define the output schema
const SentimentSchema = z.object({
  sentiment: z.enum(['Positive', 'Neutral', 'Negative']),
  confidence: z.number().min(0).max(1),
});

// Create the LLM function
const analyzeSentiment = nua.createFn({
  prompt: "Analyze the sentiment of the following text.",
  output: {
    name: "sentimentAnalysis",
    schema: SentimentSchema,
  },
});

async function main() {
  const text = "The product is great, but the shipping was delayed.";
  
  console.log("Analyzing...");
  const result = await analyzeSentiment(text);

  if (result.isSuccess) {
    console.log("Result:", result.data);
  } else {
    console.error("Error:", result.error);
  }
}

main();
```

## Step 4: Run it

Run the script using `ts-node` or `node`.

```bash theme={null}
npx ts-node index.ts
```

You should see an output similar to:

```json theme={null}
{
  "sentiment": "Positive",
  "confidence": 0.8
}
```

## What just happened?

1. You defined a **Schema** using Zod.
2. You created a **Function** with a natural language prompt.
3. Nuabase handled the prompt execution and guaranteed the output matched your schema.

## Next Steps

Now that you've seen the basics, learn how to integrate this into your actual application.

<CardGroup cols={2}>
  <Card title="Frontend Integration" icon="browser" href="/workflows/frontend">
    Securely call LLMs from your React/Vue/Web app.
  </Card>

  <Card title="Server Integration" icon="server" href="/workflows/server">
    Use Nuabase in your backend services.
  </Card>
</CardGroup>
