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

# تثبيت SDK الخاص بـ TypeScript

> كيفية تثبيت SDK الخاص بـ TypeScript من Phaseo وإعداده.

يُنشر SDK على npm باسم [`@phaseo/sdk`](https://www.npmjs.com/package/@phaseo/sdk).

## التثبيت

ثبّت SDK باستخدام مدير الحزم المفضل لديك:

<CodeGroup>
  ```bash title="npm" theme={null}
  npm install @phaseo/sdk
  ```

  ```bash title="pnpm" theme={null}
  pnpm add @phaseo/sdk
  ```

  ```bash title="yarn" theme={null}
  yarn add @phaseo/sdk
  ```
</CodeGroup>

## المتطلبات

* Node.js 18+
* TypeScript 4.5+ (لتعريفات الأنواع)

## الإعداد

### مفتاح API

تحتاج إلى مفتاح API من Phaseo لاستخدام SDK. أنشئه من [مفاتيح البوابة](https://phaseo.app/gateway/keys).

### متغيرات البيئة

اضبط مفتاح API كمتغير بيئة:

```bash theme={null}
export PHASEO_API_KEY="phaseo_v1_sk_<kid>_<secret>"
```

### الاستخدام الأساسي

```typescript theme={null}
import Phaseo from "@phaseo/sdk";

// Initialize the client
const client = new Phaseo({
	apiKey: process.env.PHASEO_API_KEY!,
});

// Make your first request
const response = await client.generateText({
	model: "openai/gpt-4o-mini",
	messages: [{ role: "user", content: "Hello!" }],
});

console.log(response.choices[0].message.content);
```

## الخطوات التالية

* راجع [دليل الاستخدام](./usage.mdx) للاطلاع على أمثلة مفصلة
* تصفّح [مرجع API](../../api-reference/introduction.mdx) لوثائق نقاط النهاية


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.