Skip to content

Commit

Permalink
restructured unreal docs, added boilerplate examples (#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
andygruening authored Nov 20, 2024
1 parent 4b28f1f commit 6b901c0
Show file tree
Hide file tree
Showing 60 changed files with 757 additions and 895 deletions.
6 changes: 3 additions & 3 deletions 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ <h1>Page Not Found</h1>
{ oldPath: "/unity-waas-sdk/read-from-blockchain", targetPath: "/sdk/unity/read-from-blockchain" },
{ oldPath: "/unity-waas-sdk/setup", targetPath: "/sdk/unity/setup" },
{ oldPath: "/unity-waas-sdk/sign-messages", targetPath: "/sdk/unity/sign-messages" },
{ oldPath: "/unreal-waas-sdk", targetPath: "/sdk/unreal/overview" },
{ oldPath: "/unreal-waas-sdk", targetPath: "/sdk/unreal/introduction" },
{ oldPath: "/unreal-waas-sdk/api-integration", targetPath: "/sdk/unreal/api-integration" },
{ oldPath: "/unreal-waas-sdk/authentication", targetPath: "/sdk/unreal/overview" },
{ oldPath: "/unreal-waas-sdk/authentication", targetPath: "/sdk/unreal/introduction" },
{ oldPath: "/unreal-waas-sdk/installation", targetPath: "/sdk/unreal/installation" },
{ oldPath: "/unreal-waas-sdk/packaging", targetPath: "/sdk/unreal/packaging" },
{ oldPath: "/unreal-waas-sdk/packaging", targetPath: "/sdk/unreal/platforms" },
{ oldPath: "/unreal-waas-sdk/setup", targetPath: "/sdk/unreal/setup" },
{ oldPath: "/waas/implementation/payloads", targetPath: "/solutions/wallets/embedded-wallet/architecture/action-payloads" },
{ oldPath: "/waas/implementation/trust-recovery", targetPath: "/solutions/wallets/embedded-wallet/architecture/trust-contract-recovery-flow" },
Expand Down
2 changes: 1 addition & 1 deletion docs/components/Landing/SDKsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const SDKsSection = () => (
icon="UnrealIcon"
title="Unreal Engine"
body="Integrate Sequence with our native Unreal Engine library."
link="/sdk/unreal/overview"
link="/sdk/unreal/introduction"
/>
<Card
icon="GolangIcon"
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/guides/unreal-ew-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Alternatively, [learn how to get the SDK from the Epic Games Marketplace.](/sdk/

### Configure your Project

Now create the `SequenceConfig.ini` file, [based on this format](/sdk/unreal/setup/), in your project's `Config/` directory and include the
Now create the `SequenceConfig.ini` file, [based on this format](/sdk/unreal/configuration/), in your project's `Config/` directory and include the
WaaS- and Project Key from the [Sequence Builder.](https://sequence.build/) Generate a 32-character encryption key. This key will be used to securely store your user credentials.
The remaining values can be filled in later or whenever new authentication options are needed.

Expand All @@ -32,7 +32,7 @@ The remaining values can be filled in later or whenever new authentication optio
Let's build on top of the Pawn `BP_CustomSpectatorPawn` and GameMode `GM_Sequence` included with the SDK by duplicating them into our project.
This will allow us to customize them as needed.

We recommend using the Built-In UI for development purposes, [learn how to create your own UI.](/sdk/unreal/authentication/intro)
We recommend using the Built-In UI for development purposes, [learn how to create your own UI.](/sdk/unreal/authentication/)

::::

Expand Down
60 changes: 0 additions & 60 deletions docs/pages/sdk/unreal/api.mdx

This file was deleted.

150 changes: 150 additions & 0 deletions docs/pages/sdk/unreal/authentication.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
---
title: Sequence - Web3 Gaming Platform - Unreal SDK Sequence API
description: Documentation for Unreal SDK API to manage sessions for the Sequence infrastructure stack for web3 gaming.
---

import TabbedContent from "../../../components/TabbedContent";

# Authenticating Users

Visit our [Platform Requirements](/sdk/unreal/platforms) page for detailed information on setting up and ensuring
that the authentication methods you choose are properly configured in your Builder project.

## Sign In with Email OTP

Sign in users with any email, and they will receive a one-time password in their inbox.
Listen for the Email Requires Code event.

<TabbedContent labels={["Blueprint"]}>
<div className="tabbed-content__content">
<img alt={'img'} src={'/img/unreal/email_otp.png'}/>
</div>
</TabbedContent>

## Social Sign In

To initiate SSO-based authentication on desktop, you need to navigate to a browser to obtain the necessary id_token.
On mobile, our SDK handles this process for you using integrated plugins.

On desktop platforms, listen for the `Sign in Web View Required` event and open the returned `Sign In URL`.
On mobile platforms, listen for the `Id Token Received` event.

### Get Google Id Token

<TabbedContent labels={["Blueprint"]}>
<div className="tabbed-content__content">
<img alt={'img'} src={'/img/unreal/google_idtoken.png'}/>
</div>
</TabbedContent>

### Get Apple Id Token

<TabbedContent labels={["Blueprint"]}>
<div className="tabbed-content__content">
<img alt={'img'} src={'/img/unreal/apple_idtoken.png'}/>
</div>
</TabbedContent>

### Start Session with Id Token

Use this method to start a session using a valid Id token from Google or Apple.

<TabbedContent labels={["Blueprint"]}>
<div className="tabbed-content__content">
<img alt={'img'} src={'/img/unreal/token_session.png'}/>
</div>
</TabbedContent>

## PlayFab

You will need to include your PlayFab Title ID in the `SequenceConfig.ini` file
during [Configuration](/sdk/unreal/configuration) and [configure PlayFab in the Builder](/solutions/builder/embedded-wallet/playfab-configuration).

### Register a new PlayFab user

<TabbedContent labels={["Blueprint"]}>
<div className="tabbed-content__content">
<img alt={'img'} src={'/img/unreal/playfab_registration.png'}/>
</div>
</TabbedContent>

### Login with existing PlayFab user

<TabbedContent labels={["Blueprint"]}>
<div className="tabbed-content__content">
<img alt={'img'} src={'/img/unreal/playfab_login.png'}/>
</div>
</TabbedContent>

## Sign In as a Guest

You can sign in users as guests. However, note that they will lose access to their wallet if they uninstall the app or sign out.

<TabbedContent labels={["Blueprint"]}>
<div className="tabbed-content__content">
<img alt={'img'} src={'/img/unreal/guest_session.png'}/>
</div>
</TabbedContent>

## Federate Accounts

With Federated Accounts, you can associate multiple login methods with a single account and wallet.
If your user has signed in with as a Guest, you will definitely want to push them towards federating their
account in order to have persistent credentials with which they can access their Sequence Embedded Wallet in subsequent sessions.
While a user is authenticated with the Sequence API, you can add an additional login method by using the appropriate federate account call.

<TabbedContent labels={["Blueprint"]}>
<div className="tabbed-content__content">
<img alt={'img'} src={'/img/unreal/email_federation.png'}/>
</div>
</TabbedContent>

## Sign Out

Clear the credentials cache and sign out the current user.

<TabbedContent labels={["Blueprint", "C++"]}>
<div className="tabbed-content__content">
<img alt={'img'} src={'/img/unreal/sign_out.png'}/>
</div>

<div className="tabbed-content__content">
```cpp
const TOptional<USequenceWallet*> WalletOptional = USequenceWallet::Get();
if (WalletOptional.IsSet() && WalletOptional.GetValue())
{
USequenceWallet * Api = WalletOptional.GetValue();
Api->SignOut();
}
```
</div>
</TabbedContent>

## List Sessions

List the active sessions.

<TabbedContent labels={["Blueprint", "C++"]}>
<div className="tabbed-content__content">
<img alt={'img'} src={'/img/unreal/list_sessions.png'}/>
</div>

<div className="tabbed-content__content">
```cpp
const TSuccessCallback<TArray<FSession>> OnSuccess = [=](TArray<FSession> Response)
{
//Response is a list of Sessions
};
const FFailureCallback OnFailure = [=](const FSequenceError& Error)
{
UE_LOG(LogTemp,Display,TEXT("Error Message: %s"),*Error.Message);
};
const TOptional<USequenceWallet*> WalletOptional = USequenceWallet::Get();
if (WalletOptional.IsSet() && WalletOptional.GetValue())
{
USequenceWallet * Api = WalletOptional.GetValue();
Api->ListSessions(OnSuccess,OnFailure);
}
```
</div>
</TabbedContent>
21 changes: 0 additions & 21 deletions docs/pages/sdk/unreal/authentication/email.mdx

This file was deleted.

38 changes: 0 additions & 38 deletions docs/pages/sdk/unreal/authentication/federated-accounts.mdx

This file was deleted.

17 changes: 0 additions & 17 deletions docs/pages/sdk/unreal/authentication/guest.mdx

This file was deleted.

57 changes: 0 additions & 57 deletions docs/pages/sdk/unreal/authentication/oidc.mdx

This file was deleted.

Loading

0 comments on commit 6b901c0

Please sign in to comment.