Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Create an instance of `EcosystemWallet` using a user's email, phone number or OA
Ecosystem Wallets support a variety of login methods:
- Email (OTP Login)
- Phone (OTP Login)
- Socials (Google, Apple, Facebook, Telegram, Farcaster, Line etc.)
- Socials (Google, Apple, Facebook, Telegram, Farcaster, Line, Github, Twitch etc.)
- SIWE (Sign-In with Ethereum)
- Custom Auth (OIDC Compatible)
- Custom Auth (Generic Auth Endpoint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Create an instance of `InAppWallet` using a user's email, phone number or OAuth.
In-App Wallets support a variety of login methods:
- Email (OTP Login)
- Phone (OTP Login)
- Socials (Google, Apple, Facebook, Telegram, Farcaster, Line etc.)
- Socials (Google, Apple, Facebook, Telegram, Farcaster, Line, Github, Twitch etc.)
- SIWE (Sign-In with Ethereum)
- Custom Auth (OIDC Compatible)
- Custom Auth (Generic Auth Endpoint)
Expand Down
49 changes: 49 additions & 0 deletions apps/portal/src/app/unity/v5/build-instructions/page.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { Callout, createMetadata } from "@doc";

export const metadata = createMetadata({
title: "Unity SDK v5 Build Instructions | thirdweb Unity SDK",
description:
"Learn how to build your Unity project with the thirdweb Unity SDK.",
});

# Build Instructions

## General

- **Build Settings:** Use `Smaller (faster) Builds` / `Shorter Build Time`.
- **Player Settings:** Use IL2CPP over Mono when available.
- **Stripping Level:** Set `Managed Stripping Level` to `Minimal` (`Player Settings` > `Other Settings` > `Optimization`). (Generally not a hard requirement unless using WalletConnect as a wallet provider option.)

## WebGL

- **WebGL Template:** None enforced, feel free to customize!
- **Compression Format:** Set to `Disabled` (`Player Settings` > `Publishing Settings`) for final builds.
- **Testing WebGL Social Login Locally:** Host the build or run it locally with `Cross-Origin-Opener-Policy` set to `same-origin-allow-popups`.

Example setup for testing In-App or Ecosystem Wallet Social Login locally:

```javascript
// YourWebGLOutputFolder/server.js
const express = require("express");
const app = express();
const port = 8000;

app.use((req, res, next) => {
res.header("Cross-Origin-Opener-Policy", "same-origin-allow-popups");
next();
});

app.use(express.static("."));
app.listen(port, () =>
console.log(`Server running on http://localhost:${port}`),
);

// run it with `node server.js`
```

No action needed for hosted builds.

## Mobile

- **EDM4U:** Comes with the package, resolves dependencies at runtime. Use `Force Resolve` from `Assets` > `External Dependency Manager` > `Android Resolver`.
- **Redirect Schemes:** Set custom schemes matching your bundle ID in `Plugins/AndroidManifest.xml` or equivalent to ensure OAuth redirects.
2 changes: 1 addition & 1 deletion apps/portal/src/app/unity/v5/page.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { OpenSourceCard, ArticleIconCard, ArticleCard, Grid } from "@doc";
import { GraduationCap } from "lucide-react";

# Unity SDK (v5)
# Unity SDK

The best Unity SDK to build cross-platform games on any EVM blockchain.

Expand Down
12 changes: 8 additions & 4 deletions apps/portal/src/app/unity/v5/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export const sidebar: SideBar = {
name: "Overview",
href: sdkSlug,
},
{
name: "Migration Guide",
href: `${sdkSlug}/migration-guide`,
},
{
name: "Getting Started",
href: `${sdkSlug}/getting-started`,
Expand All @@ -29,6 +25,10 @@ export const sidebar: SideBar = {
name: "Thirdweb Manager",
href: `${sdkSlug}/thirdwebmanager`,
},
{
name: "Build Instructions",
href: `${sdkSlug}/build-instructions`,
},
],
},
{
Expand Down Expand Up @@ -80,6 +80,10 @@ export const sidebar: SideBar = {
href: `${sdkSlug}/contracts`,
},
{ separator: true },
{
name: "Migrate from v4",
href: `${sdkSlug}/migration-guide`,
},
{
name: ".NET SDK Portal",
href: "/dotnet",
Expand Down
41 changes: 33 additions & 8 deletions apps/portal/src/app/unity/v5/thirdwebmanager/page.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

import { DocImage, createMetadata } from "@doc";
import thirdwebManager from "./thirdwebmanager.png";
import thirdwebmanager_client from "./thirdwebmanager_client.png";
import thirdwebmanager_preferences from "./thirdwebmanager_preferences.png";
import thirdwebmanager_misc from "./thirdwebmanager_misc.png";
import thirdwebmanager_debug from "./thirdwebmanager_debug.png";

export const metadata = createMetadata({
title: "Thirdweb Manager | thirdweb Unity SDK",
Expand All @@ -15,35 +18,57 @@ Add the prefab to your scene and the client will persist throughout your game's

It is entirely optional, and you can opt to use the [.NET SDK](/dotnet) directly if you prefer to do so.

<DocImage src={thirdwebManager} className="w-[600px]" />
If you are wrapping the SDK, we recommend making your own Manager inspired by `ThirdwebManager.cs`, specifically for `ThirdwebClient` initialization.

## Configuration

Configure `ThirdwebManager` through the Unity Inspector window.

Below is a list of all the settings you can adjust.

### Client Settings
### Client

This section involves the basic settings to configure the SDK:
<DocImage src={thirdwebmanager_client} />

This section involves the required thirdweb client settings to configure the SDK:

- `Client ID`: Thirdweb [API Key](https://thirdweb.com/create-api-key). Used to access thirdweb services such as RPC, Storage, and Account Abstraction.
- `Bundle ID`: The bundle ID used to access thirdweb services from native platforms. Should be the same as the bundle ID in your Unity project, e.g., `com.companyname.gamename`.
- `Create API Key`: A link to create a new API key if you don't have one.

### Preferences

<DocImage src={thirdwebmanager_preferences} />

This section allows you to define the default preferences for the SDK:

- `Initialize On Awake`: Whether the SDK should initialize on awake or not. If not, you can call `ThirdwebManager.Instance.Initialize()` to initialize it manually.
- `Show Debug Logs`: Whether to show thirdweb SDK debug logs.
- `Opt Out Usage Analytics`: Whether to opt out of Connect usage analytics, such as the number of wallets connected to your game.

### WalletConnect Settings
### Misc

<DocImage src={thirdwebmanager_misc} />

This section allows you to customize the SDK's behavior:

- `Supported Chains`: A list of chains that the wallets should be able to connect to by default when using `WalletConnect` as a wallet provider.
- `Redirect Page HTML Override`: Raw HTML to override the default redirect page when connecting to `InAppWallet` or `EcosystemWallet` providers.

### Debug

<DocImage src={thirdwebmanager_debug} />

This section allows you to define WalletConnect-specific settings:
This section allows you to find helpful information:

- `Supported Chains`: A list of chains that the wallets should be able to connect to by default. Each chain is defined by a chain ID.
- `Log Active Wallet Info`: Logs the active (last connected) wallet's information such as its address.
- `Open Documentation`: Opens the thirdweb SDK documentation in your default browser.

## Interacting with the ThirdwebManager

Once your `ThirdwebManager` is set up, you can interact with it using the following methods:

### Initialize
### Initialize (If not set to `Initialize On Awake`)

```csharp
ThirdwebManager.Instance.Initialize();
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Ecosystem Wallets have a very similar API to the [In-App Wallet](/unity/v5/walle
Ecosystem Wallets support a variety of login methods:
- Email (OTP Login)
- Phone (OTP Login)
- Socials (Google, Apple, Facebook, Telegram, Farcaster, Line etc.)
- Socials (Google, Apple, Facebook, Telegram, Farcaster, Line, Github, Twitch etc.)
- SIWE (Sign-In with Ethereum)
- Custom Auth (OIDC Compatible)
- Custom Auth (Generic Auth Endpoint)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ It makes for a fantastic [SmartWallet](/unity/v5/wallets/account-abstraction) ad
In-App Wallets support a variety of login methods:
- Email (OTP Login)
- Phone (OTP Login)
- Socials (Google, Apple, Facebook, Telegram, Farcaster, Line etc.)
- Socials (Google, Apple, Facebook, Telegram, Farcaster, Line, Github, Twitch etc.)
- SIWE (Sign-In with Ethereum)
- Custom Auth (OIDC Compatible)
- Custom Auth (Generic Auth Endpoint)
Expand Down
Loading