.NET SDK

Getting Started

To get started with the Thirdweb .NET SDK, ensure you have .NET SDK installed on your machine.

We recommend using the latest stable version of .NET.

Integration Steps

  • .NET Package Installation

    Install the Thirdweb .NET SDK via NuGet package manager:

    dotnet add package Thirdweb

    This command adds the Thirdweb SDK to your project, allowing you to interact with the blockchain in your .NET applications.

  • Initialize Thirdweb Client

    Create a new instance of the Thirdweb client in your application:

    // For Web Applications
    var client = ThirdwebClient.Create(clientId: "yourClientId");
    // For Native Applications
    var client = ThirdwebClient.Create(clientId: "yourClientId", bundleId: "yourBundleId");
    // For Backend Applications
    var client = ThirdwebClient.Create(secretKey: "yourSecretKey");

    Replace "yourClientId" and "yourBundleId" with your actual client ID and bundle ID.

  • Interact with Smart Contracts

    Now, you can start interacting with smart contracts. For example, to read from a contract:

    var contract = await ThirdwebContract.Create(client: client, address: "contractAddress", chain: chainId);
    var readResult = await contract.Read<string>(contract, "methodName");
    Console.WriteLine($"Contract read result: {readResult}");

    Replace "contractAddress", chainId, and "methodName" with your contract's address, the chain ID, and the method name you wish to call.

  • Explore Advanced Features

    Check the SDK documentation for more advanced features like interacting with smart wallets, signing messages, and performing transactions.

Gaming Integrations