> For the complete documentation index, see [llms.txt](https://easyauth.papelship.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://easyauth.papelship.com/csharp-document/main-functions/serverside-string.md).

# Serverside String

Serverside Variables allow you to store sensitive configuration parameters, encryption keys, API endpoints, webhooks, and license-restricted offsets on the authentication server. These values are never stored inside your compiled `.NET` binary and are only decrypted into memory after successful authentication.

## Overview

```mermaid
sequenceDiagram
    participant CSharp as C# Application
    participant Server as EasyAuth Server
    
    Note over CSharp,Server: User is Authenticated
    CSharp->>Server: GetVariable("secret_api_endpoint", licenseKey, apiKey)
    Server-->>CSharp: Encrypted Variable Payload
    Note over CSharp: Variable stored strictly in memory
```

## C# Implementation

{% tabs %}
{% tab title="Basic String Retrieval" %}

```csharp
using System;
using qPapelEasyAuth;

public class ConfigurationService
{
    public static string FetchEndpoint(string licenseKey, string apiKey)
    {
        // Retrieves remote variable as string
        string endpoint = qPapelEasyAuth.qPapelEasyAuth.GetVariable("backend_api_url", licenseKey, apiKey);

        if (string.IsNullOrEmpty(endpoint))
        {
            Console.WriteLine("[-] Failed to retrieve remote variable or variable is empty.");
            return string.Empty;
        }

        Console.WriteLine($"[+] Successfully retrieved variable.");
        return endpoint;
    }
}
```

{% endtab %}

{% tab title="Extended Query with Type Metadata" %}

```csharp
// Query variable with detailed metadata (type, error status)
VariableResult varResult = qPapelEasyAuth.qPapelEasyAuth.GetVariableEx("database_connection_str", licenseKey, apiKey);

if (varResult.Success)
{
    Console.WriteLine($"[+] Variable Name : database_connection_str");
    Console.WriteLine($"[+] Value Type    : {varResult.Type}");
    Console.WriteLine($"[+] Decrypted Val : {varResult.Value}");
}
else
{
    Console.WriteLine($"[-] Error: {varResult.Message} ({varResult.ErrorName})");
}
```

{% endtab %}
{% endtabs %}

## Variable Types Supported

| Type      | Description                          | Usage Example                                |
| --------- | ------------------------------------ | -------------------------------------------- |
| `string`  | Standard plaintext or JSON string    | Dynamic endpoints, public keys, JSON schemas |
| `integer` | Numeric configuration value          | Build version, port numbers, timeout limits  |
| `boolean` | Feature toggle flag (`true`/`false`) | Beta feature gating, maintenance switches    |
| `json`    | Structured object payload            | Feature flag collections, game offsets       |

## Security Best Practices

* **Never Log Sensitive Variables**: Avoid printing raw decrypted variable values into console output or debug logs in production builds.
* **Short-Lived Retention**: Keep sensitive credentials in scoped variables rather than static long-lived fields to minimize memory exposure.

{% hint style="info" %}
Variables can be scoped to specific products or specific user license tiers from the web management dashboard.
{% endhint %}
