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

# Getting Started with PHP SDK

> [!NOTE]
>
> **Prerequisites**
>
> * [Castled CEP account is already setup](https://docs.castled.io/account-management/user-signup.md)

The Castled PHP SDK empowers your PHP-based backend servers to transmit user attributes and events to Castled. This data can serve as triggers for campaigns or workflows, or be synchronized with your data warehouse for advanced customer segmentation.
The following steps will guide you through the process of integrating the SDK with your PHP application.

## SDK installation

Make sure the vendor/autoload.php file is included once at the beginning of your application's entry point. Then use the PHP composer to install the latest stable version of castled php sdk.

```php
require_once __DIR__ . '/vendor/autoload.php';

composer require castledio/castled-php-sdk
```

## SDK initialization

Now initialise the SDK using the init method and pass the Api-Key generated from the Castled Dashboard. You can create a new api key for your workspace at **Settings > Api Keys**.

```php
   Castled::init(<Your API Key>);
```


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