# Starting and Configuring the SDK

This feature starts the Flagship SDK using your specific credentials and the necessary configuration parameters. This is typically the initial step when utilizing the Flagship SDK.

In the context of the Flagship SDK, a "decision" refers to the process of assigning variations to a visitor based on the targeting criteria of a campaign.

You can use either the `Api` mode or the `Bucketing` mode to start the SDK. In the `API` mode whenever you fetch your flags, an HTTP request is made to Flagship to take decisions. However in `Bucketing`mode, the decisions are made locally on the client side.

It's recommended to start the SDK just once in the most appropriate location for your application.

Below are examples of how to initialize and configure the SDK in different programming environments:

{% tabs %}
{% tab title="TypeScript" %}

```javascript
import { Flagship, DecisionMode, CacheStrategy, LogLevel } from "@flagship.io/js-sdk";

await Flagship.start("<ENV_ID>", "<API_KEY>", {
  deciswaionMode: DecisionMode.DECISION_API,
  timeout: 10,
  logLevel: LogLevel.INFO,
});
```

{% endtab %}

{% tab title="React" %}

```python
import React from "react";
import { FlagshipProvider } from "@flagship.io/react-sdk";

const App = () => (
  <>
    <FlagshipProvider
      envId="YOUR_ENV_ID"
      apiKey="YOUR_API_KEY"
      visitorData={null}
    >
      {/* ... */}
    </FlagshipProvider>
  </>
);
```

{% endtab %}

{% tab title="React Native" %}

```jsx
import React from "react";
import { FlagshipProvider } from "@flagship.io/react-native-sdk";

const App = () => (
  <>
    <FlagshipProvider
      envId="YOUR_ENV_ID"
      apiKey="YOUR_API_KEY"
      visitorData={null}
    >
      {/* ... */}
    </FlagshipProvider>
  </>
);
```

{% endtab %}

{% tab title="PHP" %}

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

use Flagship\Config\FlagshipConfig;
use Flagship\Enum\LogLevel;
use Flagship\Flagship;

$config = FlagshipConfig::decisionApi()
    ->setLogLevel(LogLevel::DEBUG)
    ->setTimeout(2000)

Flagship::start("<ENV_ID>", "<API_KEY>", $config);
```

{% endtab %}

{% tab title=".NET" %}

```csharp
using Flagship.Config;
using Flagship.Main;

Fs.Start("<ENV_ID>", "<API_KEY>", new DecisionApiConfig(){
    LogLevel = Flagship.Enums.LogLevel.DEBUG
});

```

{% endtab %}
{% endtabs %}

Each SDK offers a variety of configuration options to manage its behavior. For more detailed information about possible configurations, please consult the reference documentation for your specific SDK:

| SDK                                                                                       |
| ----------------------------------------------------------------------------------------- |
| [Javascript](/server-side/sdks/js-sdk.md)                                                 |
| [React-JS](/server-side/sdks/react/react-js-reference.md#flagshipprovider)                |
| [React-Native](/server-side/sdks/react-native/react-native-reference.md#flagshipprovider) |
| [PHP](/server-side/sdks/net/net-reference.md#start-method)                                |
| [.NET](/server-side/sdks/net/net-reference.md#start-method)                               |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/server-side/sdks/key-features/starting-and-configuring-the-sdk.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
