# SDK Reference

Reference for the Superwall Unity SDK beta C# API.

The Unity SDK exposes the `Superwall` namespace. Configure the SDK once with the static
`Superwall.Configure(...)` method, then use `Superwall.Shared` for placement registration, user
management, subscription state, and paywall utilities.

`Superwall.Configure` [#superwallconfigure]

```csharp C#
public static Superwall Configure(
    string apiKey,
    SuperwallOptions options = null,
    IPurchaseController purchaseController = null,
    Action<ConfigurationResult> completion = null
)
```

<TypeTable
  type="{
  apiKey: {
    type: &#x22;string&#x22;,
    description: &#x22;Your Superwall Public API Key.&#x22;,
    required: true,
  },
  options: {
    type: &#x22;SuperwallOptions&#x22;,
    typeDescriptionLink: &#x22;/unity/guides/advanced-configuration#superwalloptions&#x22;,
    description: &#x22;Optional SDK configuration.&#x22;,
    default: &#x22;null&#x22;,
  },
  purchaseController: {
    type: &#x22;IPurchaseController&#x22;,
    typeDescriptionLink: &#x22;/unity/guides/custom-purchase-controller&#x22;,
    description: &#x22;Optional custom purchase and restore handler.&#x22;,
    default: &#x22;null&#x22;,
  },
  completion: {
    type: &#x22;Action<ConfigurationResult>&#x22;,
    description: &#x22;Optional callback invoked after native configuration completes.&#x22;,
    default: &#x22;null&#x22;,
  },
}"
/>

`RegisterPlacement` [#registerplacement]

```csharp C#
public void RegisterPlacement(
    string placement,
    Dictionary<string, object> parameters = null,
    PaywallPresentationHandler handler = null,
    Action feature = null
)
```

<TypeTable
  type="{
  placement: {
    type: &#x22;string&#x22;,
    description: &#x22;Placement name configured in the Superwall dashboard.&#x22;,
    required: true,
  },
  parameters: {
    type: &#x22;Dictionary<string, object>&#x22;,
    description: &#x22;Optional placement parameters for audience filters and paywall variables.&#x22;,
    default: &#x22;null&#x22;,
  },
  handler: {
    type: &#x22;PaywallPresentationHandler&#x22;,
    description:
      &#x22;Optional callbacks for paywall presentation, dismissal, errors, skips, and custom callbacks.&#x22;,
    default: &#x22;null&#x22;,
  },
  feature: {
    type: &#x22;Action&#x22;,
    description: &#x22;Callback that runs when the user has access to the feature.&#x22;,
    default: &#x22;null&#x22;,
  },
}"
/>

Common Methods and Properties [#common-methods-and-properties]

<TypeTable
  type="{
  SetDelegate: {
    type: &#x22;void SetDelegate(ISuperwallDelegate superwallDelegate)&#x22;,
    description: &#x22;Sets or clears the delegate that receives lifecycle callbacks.&#x22;,
  },
  Identify: {
    type: &#x22;void Identify(string userId, IdentityOptions identityOptions = null)&#x22;,
    description: &#x22;Identifies the current user.&#x22;,
  },
  Reset: {
    type: &#x22;void Reset()&#x22;,
    description: &#x22;Resets the current user and returns to anonymous identity.&#x22;,
  },
  SetUserAttributes: {
    type: &#x22;void SetUserAttributes(Dictionary<string, object> attributes)&#x22;,
    description: &#x22;Sets user attributes for targeting and personalization.&#x22;,
  },
  SubscriptionStatus: {
    type: &#x22;SubscriptionStatus&#x22;,
    description: &#x22;Gets or sets the current subscription status.&#x22;,
  },
  GetCustomerInfo: {
    type: &#x22;void GetCustomerInfo(Action<CustomerInfo> completion)&#x22;,
    description: &#x22;Fetches customer info asynchronously.&#x22;,
  },
  GetPresentationResult: {
    type: &#x22;void GetPresentationResult(string placement, Dictionary<string, object> parameters = null, Action<PresentationResult> completion = null)&#x22;,
    description: &#x22;Checks what Superwall would do for a placement without presenting it.&#x22;,
  },
  PreloadAllPaywalls: {
    type: &#x22;void PreloadAllPaywalls()&#x22;,
    description: &#x22;Preloads all paywalls from the current configuration.&#x22;,
  },
  PreloadPaywallsForPlacements: {
    type: &#x22;void PreloadPaywallsForPlacements(List<string> placementNames)&#x22;,
    description: &#x22;Preloads paywalls for the provided placement names.&#x22;,
  },
  HandleDeepLink: {
    type: &#x22;bool HandleDeepLink(string url)&#x22;,
    description: &#x22;Passes a URL to the native SDK for deep link handling.&#x22;,
  },
  Dismiss: {
    type: &#x22;void Dismiss()&#x22;,
    description: &#x22;Dismisses the currently presented paywall.&#x22;,
  },
  Purchase: {
    type: &#x22;void Purchase(string productId, Action<PurchaseResult> completion)&#x22;,
    description: &#x22;Purchases a product directly without presenting a paywall.&#x22;,
  },
  GetProducts: {
    type: &#x22;void GetProducts(List<string> productIds, Action<Dictionary<string, StoreProduct>> completion)&#x22;,
    description: &#x22;Fetches store product details by product ID.&#x22;,
  },
  RefreshConfiguration: {
    type: &#x22;void RefreshConfiguration()&#x22;,
    description: &#x22;Forces a configuration refresh.&#x22;,
  },
  IsConfigured: {
    type: &#x22;bool&#x22;,
    description: &#x22;Whether the native SDK is configured.&#x22;,
  },
  IsPaywallPresented: {
    type: &#x22;bool&#x22;,
    description: &#x22;Whether a paywall is currently presented.&#x22;,
  },
}"
/>

Presentation Handler [#presentation-handler]

```csharp C#
public class PaywallPresentationHandler
{
    public Action<PaywallInfo> OnPresent;
    public Action<PaywallInfo, PaywallResult> OnDismiss;
    public Action<string> OnError;
    public Action<PaywallSkippedReason> OnSkip;
    public Func<CustomCallback, CustomCallbackResult> OnCustomCallback;
}
```

Related Guides [#related-guides]

* [Install the SDK](/docs/unity/quickstart/install)
* [Configure the SDK](/docs/unity/quickstart/configure)
* [Presenting Paywalls](/docs/unity/quickstart/present-paywalls)
* [Advanced Configuration](/docs/unity/guides/advanced-configuration)
* [Custom Purchase Controller](/docs/unity/guides/custom-purchase-controller)